TheSky Posted June 25, 2011 Share Posted June 25, 2011 <?php //load it all into the associative array include('connect.php'); $sql=mysql_query("SELECT username,today FROM x_data WHERE status='ACTIVE' ORDER BY id ASC") or die(mysql_error()); while($row = mysql_fetch_row($sql)) { $myArray[$row[0]] = $row[1]; } //now we expand it while(list($username,$check) = each($myArray)) { echo($username,$check(include('db_query.php'))'<br />'); } ?> i want run every row with my include file (db_query.php) but seems im making wrong in the echo part. Link to comment https://forums.phpfreaks.com/topic/240358-doing-include-wrong/ Share on other sites More sharing options...
MadTechie Posted June 25, 2011 Share Posted June 25, 2011 Surely if you just want to include db_query.php X times, then your just need to do this //now we expand it while(list($username,$check) = each($myArray)) { include('db_query.php'; echo '<br />'; } Link to comment https://forums.phpfreaks.com/topic/240358-doing-include-wrong/#findComment-1234646 Share on other sites More sharing options...
TheSky Posted June 25, 2011 Author Share Posted June 25, 2011 thanks you are awsome! //now we expand it while(list($username,$check) = each($myArray)) { include('db_query.php'); echo '<br />'; } there was typo but it works as i expected. Link to comment https://forums.phpfreaks.com/topic/240358-doing-include-wrong/#findComment-1234653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.