liquid79 Posted December 12, 2007 Share Posted December 12, 2007 The problem im having is it only displays the places it found results for not all of them even if they have results or not which i want it to do. At the moment is displays: place1 (2) place2 (1) Im trying to get it to display: place1 (2) place2(1) place3(0) place4(0) place5(0) My Code: // Selects all the placenames where the district = district $sql = mysql_query("SELECT * FROM places WHERE area = '$district' LIMIT 24"); while($row4 = mysql_fetch_object($sql)) { //Counts districts where they = the get values ie.district, p_type and the placename from the above results $sql2 = mysql_query("SELECT image_id, district, p_type, p_location, Active, COUNT(district) AS num FROM details_temp2 WHERE district = '$district' AND p_type = '$p_type' AND p_location = '$row4->placename' AND Active ='1' GROUP BY district"); while($row5 = mysql_fetch_object($sql2)){ // display a column with all the places names echo'<tr> <td bgcolor="#a3cbfd" class="rollover"><a href="show_propertys.php?type=">'.$row4->placename.' </a></td>'; // display a column with how many results it found for each place echo' <td bgcolor="#a3cbfd" class="rollover">('.$row5->num.') </td>'; } } Hope this makes some sense! (just thought sorry if this is a mysql question.. im not sure if it is or not) Quote Link to comment https://forums.phpfreaks.com/topic/81368-outputing-rows-even-if-they-dont-match/ 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.