lional Posted July 20, 2006 Share Posted July 20, 2006 I am trying to create a drop-down box where the variables are pulled from a mysql table. The drop-down box is for cities that the client exists. The roblem that I am having is that there may be more than one entry of the same city if more than one client exists in the same city, but I only want one to appear in the drop-down box. How do I use PHP to only show one entry n the drop_down when multiple entries exist.ThanksLional Link to comment https://forums.phpfreaks.com/topic/15118-avoiding-multiple-entries/ Share on other sites More sharing options...
brown2005 Posted July 20, 2006 Share Posted July 20, 2006 $query=mysql_query("SELECT members_county, COUNT(*) AS no FROM members GROUP BY members_county;");while($r=mysql_fetch_array($query)) {echo $r[members_county]." (".$r[no].")<br />";}just substitue ur values Link to comment https://forums.phpfreaks.com/topic/15118-avoiding-multiple-entries/#findComment-60892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.