RE: [PHP] Getting the last record in a mysql table
| From: | Jason Murray | Date: | Fri, 18 Jan 2002 05:40:01 +0000 |
| Subject: | RE: [PHP] Getting the last record in a mysql table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81030@lists.php.net to get a copy of this message | ||
> I thought this would be easy but it ain't. What I want is
> the id number of the last record in a table.
If you use mysql_num_rows() and decrement it by one, you'll
have the ID of the row you can use with mysql_result.
Jason