DEVILofDARKNESS Posted September 3, 2009 Share Posted September 3, 2009 okay I have the following piece of code: $query = "SELECT `nation_id` , COUNT( `region_id` ) AS `regions_count` FROM `regions` WHERE in_use = 'Yes' GROUP BY `regions`.`nation_id` ORDER BY`regions_count` DESC"; $result = mysql_query($query); while($array = mysql_fetch_array($result)){ //$idnation = $array['nation_id']; $query = "SELECT nation_name FROM nations WHERE nation_id = '" . $array['nation_id'] . "'"; $result = mysql_query($query); list($namenation) = mysql_fetch_row($result); echo $namenation; } But this gives only one name, if don't do the second query but direct output the $array['nation_id'] I DO get more rows, so Where is the problem? *This can be more related to Mysql Forum but I wasn't sure. So sorry if it is Link to comment https://forums.phpfreaks.com/topic/173003-solved-problem-with-array/ Share on other sites More sharing options...
DEVILofDARKNESS Posted September 3, 2009 Author Share Posted September 3, 2009 Solved it my own, I thought damn with inner joins I can make it me a lot easier so it was a mysql problem... Link to comment https://forums.phpfreaks.com/topic/173003-solved-problem-with-array/#findComment-911805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.