Hi, I am trying to use this code to take all the unique town names from one table and populate a new table with those towns.
this code doesnt add town names to the new table and deletes any that are there with blank space - any clues?
mysql_select_db($database_contractors, $contractors);
$query_Recordset3 = "SELECT DISTINCT est_town FROM hotels";
$res3 = mysql_query($query_Recordset3, $contractors) or die(mysql_error());
$num_rows = mysql_num_rows($res3);
echo $num_rows . "<br>";
while( $row = mysql_fetch_assoc($res3) ) {
$town = $row['est_town'];
echo $town . "<br />" ;
mysql_query('UPDATE town_coords SET town_name = '.$town.'');
}