I have a class where I collect all the comments. then I need to insert these comments into another page, but since I make a template, I have a request to the database itself and the result of the request is stored in a class function, and then I just call it on the page and insert the values where necessary (two-dimensional array).
in class
public function GetComments(){ $result = mysql_query("SELECT * FROM comments"); return mysql_fetch_row($result); }
and already on the page I received and remembered the result of the function in a variable and output
<?php foreach ($allComments as $value) { ?> <tr> <td><?=$value;?></td> <td><?=$value;?></td> <td><?=$value;?></td> </tr> <?php } ?>
but only 1 query string is passed to $ allComments. if I do not insert mysql_fetch_row in the function, then the resource is returned (and I would have an array). how would i fix this whole thing. broke my head
UPD. the issue is resolved