Re: COUNT() returns 1, but should be 0
| From: | Tobey Wheelock | Date: | Mon, 22 Dec 2003 02:57:38 +0000 |
| Subject: | Re: COUNT() returns 1, but should be 0 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32148@lists.php.net to get a copy of this message | ||
On Mon, Dec 22, 2003 at 11:43:35AM +0900, Lew Mark-Andrews wrote:
> Table structure for cardlist:
>
visitdate datetime default NULL,
> $sql = "SELECT COUNT(visitdate) FROM cardlist GROUP BY visitdate";
> $visitcount = mysql_num_rows($query);
> echo "<p>Total number of visits: $visitcount</p><br>"; // <---
> Should be zero.
I think that there is one visitdate (NULL), so one row is returned.
HTH,
Tobey Wheelock