RE: [PHP-GENERAL] mysq: get the latest row of a table
| From: | Chris Sano | Date: | Sun, 25 Jun 2000 01:49:09 +0000 |
| Subject: | RE: [PHP-GENERAL] mysq: get the latest row of a table | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2940@lists.php.net to get a copy of this message | ||
mysql_num_rows(); will obtain the number of rows.
if you do something similar to this:
$lastrow = (mysql_num_rows($db) - 1), that should work.
Chris
-----Original Message-----
From: Michael Govorun [mailto:mike@nrg-online.ru]
Sent: Saturday, June 24, 2000 12:47 PM
To: peter@vardus.com
Cc: php-general@lists.php.net
Subject: Re: [PHP-GENERAL] mysq: get the latest row of a table
>Hi,
>I've been thinking about this on and off now for a while, is there a fast
>way to just get the latest row of a table? Looping through all just seems
>like such a waste of time, I'm sure there must be a better way!
>Thanks for any hints you can give,
>Peter
try mysql_data_seek()
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net