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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/15118-avoiding-multiple-entries/#findComment-60892 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.