Jump to content

Archived

This topic is now archived and is closed to further replies.

lional

Avoiding multiple entries

Recommended Posts

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.

Thanks

Lional

Share this post


Link to post
Share on other sites
$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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.