Re: mysql results with limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Gale wrote:
Hello,

	Right now I have a mysql select statement with the LIMIT option of 500.
Is there a way to find what the total number of selected results would
of been with out doing a mysql select first with out the limi and using
mysql_num_rows ?

Thanks


You could use SQL_CALC_FOUND_ROWS as it works somewhat differently, and probably faster, than the approach you suggest above. This function was introduced in mysql 4.0.0.

http://dev.mysql.com/doc/mysql/en/Information_functions.html

Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux