tjverge Posted April 26, 2011 Share Posted April 26, 2011 I think the problem is with echo "<td>".$row["countnow($i)"]."</td>"; it's not showing anything, any ideas how to fix it? $i = 1; While ($i <25) { ?> <tr> <td><?php echo $i; ?></td> <?php $sql = "SELECT * FROM `systems` WHERE `solarSystemName` LIKE $sname" or die (mysql_error()); $result = mysql_query($sql); while ($row = mysql_fetch_array($result)){ echo "<td>".$row["countnow($i)"]."</td>"; } ?> <tr> <?php $i++; } Link to comment https://forums.phpfreaks.com/topic/234779-nested-while-loop/ Share on other sites More sharing options...
Pikachu2000 Posted April 26, 2011 Share Posted April 26, 2011 Do you actually have fields in the `systems` table named `countnow1`, `countnow2`, `countnow3` . . . `countnow24`? Link to comment https://forums.phpfreaks.com/topic/234779-nested-while-loop/#findComment-1206571 Share on other sites More sharing options...
tjverge Posted April 26, 2011 Author Share Posted April 26, 2011 No column names are 1 - 24, countnow is a function Link to comment https://forums.phpfreaks.com/topic/234779-nested-while-loop/#findComment-1206572 Share on other sites More sharing options...
Pikachu2000 Posted April 26, 2011 Share Posted April 26, 2011 Actually, countnow($i) is a string by virtue of the fact that it's quoted. Remove the quotes if its to be treated as a function. Link to comment https://forums.phpfreaks.com/topic/234779-nested-while-loop/#findComment-1206576 Share on other sites More sharing options...
tjverge Posted April 26, 2011 Author Share Posted April 26, 2011 It worked that time, I could of swore I tried that earlier and it would not work. thank again for the help Link to comment https://forums.phpfreaks.com/topic/234779-nested-while-loop/#findComment-1206581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.