PHP MySQL Query based on number of results returned

$sql = "SELECT * FROM tbl";
$result = mysql_query($sql);
if (mysql_num_rows($result)==0)
{
//do this
}
else
{
//do that
}