note 44493 deleted from function.mysql-fetch-assoc by betz
| From: | betz@php.net | Date: | Wed, 05 Oct 2005 11:42:23 +0000 |
| Subject: | note 44493 deleted from function.mysql-fetch-assoc by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96433@lists.php.net to get a copy of this message | ||
Note Submitter: Olivier Fabre
----
If your query is something like:
SELECT MAX(time) FROM table GROUP BY id
then $row = mysql_fetch_assoc() won't create $row['time'], nor
$row['MAX(time)'].
Like for multi tables queries, the solution is to use an alias in the query:
SELECT MAX(time) as time FROM table GROUP BY id