RE: [PHP-DB] last record of mysql table
| From: | Rick Emery | Date: | Tue, 09 Oct 2001 20:48:11 +0000 |
| Subject: | RE: [PHP-DB] last record of mysql table | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13162@lists.php.net to get a copy of this message | ||
One of the fields should be of type TIMESTAMP
Then select/sort on TIMESTAMP descending and set limit to 1
That does it!
-----Original Message-----
From: Ivan Balazs [mailto:ibalazs@sch.bme.hu]
Sent: Tuesday, October 09, 2001 3:19 PM
To: php-db@lists.php.net
Subject: [PHP-DB] last record of mysql table
Hi all!
Problem: I'd like to get the last inserted record of a table in a mysql
database. In other words: to obtain the last row of the table.
Specifically the thing is this: I'm making an adveritsement site, and I'd
like to get the latest ad submitted.
Question: how to do that?
Thanx
Balazs
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net