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 Quote Link to comment 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... Quote Link to comment 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.