If you have only one (or zero) line to pull.
$result = mysql_query();
$row = mysql_fetch_array($result);
mysql_free_result($result);
If there is a line, it will be $row. If not, there $rowwill be false. No need for while().
If you just want to find out how many lines you have
$count = mysql_num_rows($result);