You need to do a mysql query before you use the mysql_fetch_array() function on the result.
Put your query before you while loop like this.
<?php
$count=0;
$result=mysql_query("SELECT somecolumn where someothercolumn='somevalue'");
while ($r=mysql_fetch_array ($result) ) {
$City=$r["City"];
$count++;
echo " <td>$City</td>";
if ($count%3==0) //every third row
{
echo "</tr><tr>";
}
} ?>