note 17119 added to function.mysql-fetch-object
| From: | php-general at lists dot php dot net | Date: | Tue, 27 Nov 2001 05:04:30 +0000 |
| Subject: | note 17119 added to function.mysql-fetch-object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21310@lists.php.net to get a copy of this message | ||
Actually the syntax should be:
SELECT COUNT(*) AS total FROM users;
>When selecting with a count/sum, the >field must be named.
>select count(*) from users;
>becomes
>select count(*) "total" from users;
>This way the result can be referenced >as:
>$row->total;
--
http://www.php.net/manual/en/function.mysql-fetch-object.php
http://master.php.net/manage/user-notes.php?action=edit+17119
http://master.php.net/manage/user-notes.php?action=delete+17119
http://master.php.net/manage/user-notes.php?action=reject+17119