public function numRows($result) { if (is_bool($result)) { return 0; } return mysql_num_rows($result); }