note 10643 added to mysql_fetch_object
| From: | amackenz at cs dot uml dot edu | Date: | Mon, 15 Jan 2001 04:03:33 +0000 |
| Subject: | note 10643 added to mysql_fetch_object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9801@lists.php.net to get a copy of this message | ||
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