Hi, i was wondering if it is possible to use a php include within a while loop. like this. i tried it but the results are not showing. i only get the first result from the query.
the resultscontainer.php file contains a table to display the query. but i seem to be only getting the first result. but if i were to just paste the table there, the while loop works fine. is there something im missing out?
Thanks.
PHP:
<?php while($data = mysql_fetch_array($result)) {?>
<div id="resultswrapper">
<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/resultscontainer.php"; include_once($path);?>
</div>
<?php }?>
the resultscontainer.php file contains a table to display the query. but i seem to be only getting the first result. but if i were to just paste the table there, the while loop works fine. is there something im missing out?
Thanks.
Last edited: