OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: [PHP-DB] mysql limit

From: gerald_clark (gerald_clarksuppliersystems.com)
Date: Fri Jul 02 2004 - 09:22:37 CDT


If I want 20 rows to display, I ask for 21.
If I get 21, I know to ask for another page.

Bob Lockie wrote:

> Moved from a PHP list to a MySQL list. :-)
>
> On 06/30/2004 09:55 PM John W. Holmes spoke:
>
>> Bob Lockie wrote:
>>
>>> If I select rows with a limit clause I need to know if there are
>>> more rows than the limit.
>>
>>
>>
>> Either do a SELECT COUNT(*) prior to your LIMIT query to see how many
>> total rows there are, or use SQL_CALC_FOUND_ROWS and FOUND_ROWS()
>> (more info here:
>> http://dev.mysql.com/doc/mysql/en/Information_functions.html)
>
>
> Is found_rows standard SQL?
> I want to easily portable code.
> Maybe I should use a select count first. :-)
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql