I found this question Count number of times value appears in column in MySQL and I want to tie up to it. I want to put the result of the query into a variable. I tried
$sql=mysql_query("SELECT COUNT( * ) FROM myTable WHERE town = 'Sydney'");
echo $sql;
But this will echo whole command, not the result (which should be 2) Any ideas on this?