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. Quote 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 />'; } Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/240358-doing-include-wrong/#findComment-1234653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.