EchoFool Posted September 2, 2008 Share Posted September 2, 2008 Hey im slightly stuck with an array im trying to while loop as i think i got it slightly wrong =/ The while loop is built with this: <?php While loop etc { $a[] = $row['ID']; //contructing the array } ?> Then i tried this to while loop it: <?php While($a){ $Select = mysql_query("SELECT CityID FROM mitable WHERE ID='$a' GROUP BY CityID") Or die(mysql_error()); $row = mysql_fetch_assoc($Select); $CityID = $row['CityID']; Echo $CityID.'<br>'; // rest of while loop here unrelated to it } ?> Can you see where i went wrong? Link to comment https://forums.phpfreaks.com/topic/122397-help-with-arrays/ Share on other sites More sharing options...
The Little Guy Posted September 2, 2008 Share Posted September 2, 2008 Your loop should be formatted like this: while(argument){ // loop data } Link to comment https://forums.phpfreaks.com/topic/122397-help-with-arrays/#findComment-632024 Share on other sites More sharing options...
EchoFool Posted September 2, 2008 Author Share Posted September 2, 2008 Your loop should be formatted like this: while(argument){ // loop data } What is argument ? Is that a built in php function ? Link to comment https://forums.phpfreaks.com/topic/122397-help-with-arrays/#findComment-632030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.