note 44493 added to function.mysql-fetch-assoc
| From: | OlivierFabre at osu1 dot php dot net | Date: | Sun, 08 Aug 2004 00:07:55 +0000 |
| Subject: | note 44493 added to function.mysql-fetch-assoc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74178@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-assoc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44493
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44493&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44493&report=yes
Search -- http://master.php.net/manage/user-notes.php