Hi, firstly i am an absolute novice, so please be patient, i'm trying to produce a search function for a web page from a db. The database is one of names, addresses etc etc .. so firstly i would like to pull all the cities from the database, which i have done like so // Formulate Query// This is the best way to perform a SQL query// For more examples, see mysql_real_escape_string()$query = sprintf("SELECT DISTINCT Cities FROM PBM");// Perform Query$result = mysql_query($query);// Check result// This shows the actual query sent to MySQL, and the error. Useful for debugging.if (!$result) {$message = 'Invalid query: ' . mysql_error() . "\n";$message .= 'Whole query: ' . $query;die($message);}echo "<br />";echo "<table border='0'>";// Use result// Attempting to print $result won't allow access to information in the resource// One of the mysql result functions must be used// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.while ($row = mysql_fetch_assoc($result)){echo "<tr><td>";echo "</td><td align='left'>";echo $row['Cities'];echo "</td></tr>";}echo "</table>";// Free the resources associated with the result set// This is done automatically at the end of the scriptmysql_free_result($result);So this works and produces a nice list of all the cities with all duplicates removed .. unfortunately this is as far as i have got as i am an absolute novice.What i need is to firstly produce the above results in a selectable drop down, instead of a table.Then when a City is selected from the drop down, it will return results of all Names and adresses etc .. i hope i have made myself clear ..Thanks // Formulate Query // This is the best way to perform a SQL query // For more examples, see mysql_real_escape_string() $query = sprintf("SELECT DISTINCT Cities FROM PBM"); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } echo "<br />"; echo "<table border='0'>"; // Use result // Attempting to print $result won't allow access to information in the resource // One of the mysql result functions must be used // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while ($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "</td><td align='left'>"; echo $row['Cities']; echo "</td></tr>"; } echo "</table>"; // Free the resources associated with the result set // This is done automatically at the end of the script mysql_free_result($result);// Formulate Query // This is the best way to perform a SQL query // For more examples, see mysql_real_escape_string() $query = sprintf("SELECT DISTINCT Cities FROM PBM"); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } echo "<br />"; echo "<table border='0'>"; // Use result // Attempting to print $result won't allow access to information in the resource // One of the mysql result functions must be used // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while ($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "</td><td align='left'>"; echo $row['Cities']; echo "</td></tr>"; } echo "</table>"; // Free the resources associated with the result set // This is done automatically at the end of the script mysql_free_result($result);