lets say i have 100 members and 50 are from chicago and 10 are from boston and so on how would i get the populated list to only show chicago once and boston once instead of 50 chicago and 10 boston
heres the code im using
<form method="post" action="index.php?id=local">
Select City
<select style="width:10%" name="location">
<?php
include("config.php");
$r = mysql_query("select * from users");
while($row = mysql_fetch_assoc($r))
{
echo "<option value='{$row['location']}'>{$row['location']}</option>";
}
?>
</select>
<input type="Submit" name="Submit" value="Submit">
</form>
and the search file
<?
include("config.php");
$search=$_POST["location"];
$result = mysql_query("SELECT * FROM users WHERE location LIKE '%$search%'");
//grab all the content
while($r=mysql_fetch_array($result))
{
//modify these to match your mysql table columns
$name=$r["username"];
$locate=$r["location"];
echo "$name <br> $locate<br /><br />";
}
?>
Thanks to anyone who can help
