note 10643 modified in function.mysql-fetch-object by zak
| From: | zak@php.net | Date: | Tue, 27 Nov 2001 08:04:42 +0000 |
| Subject: | note 10643 modified in function.mysql-fetch-object by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21314@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(*) as total from users;
This way the result can be referenced as:
$row->total;
--was--
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