your code makes no sense.
if ( mysql_num_rows() equals 0 )
{
then error in mysql_num_rows
}
while ( mysql_row_rows() less than 0 ) #how can you have -1 rows?
{
there are x listings in the database
}
make things simple (and fast). to speed up the following, have it count the column that is set as auto_increment and not all columns (*).
<?
$query = "SELECT COUNT(*) FROM $tableName";
$query_results = mysql_db_query("$databaseName",$query);
$row = mysql_fetch_array($query_results);
$total_rows = $row[0];
echo "There are $total_rows listings in the database";
?>