Question
counting records
I am trying to count how many records i have in my database. I have the following code:
$query = ("SELECT COUNT(email)
FROM early_reg;");
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
$count = mysql_num_rows($result);
}
It only returns 1, but there are actually 2 records. Is there something wrong with the syntax?