RE: Strange query

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

 



The second limit parameter is the actual number of rows to limit to, and in
most situations this is usually the same number (i.e. 0,15; 15,15; 30,15;
etc).  It is too bad this clause is not supported by some of the other
databases I have had to use, it makes a convenient way of paging where the
second paging parameter specifies the page size in terms of rows to retrieve
(first parameter is the starting row number starting with zero).

Warren Vail


-----Original Message-----
From: Ryan A [mailto:ryan@xxxxxxxxxxxx] 
Sent: Thursday, November 04, 2004 11:49 AM
To: php-general@xxxxxxxxxxxxx
Subject:  Strange query


Hi,
I am running this query from my script:

  $query = "select gallery_url,description from members limit
".$limit[0].",".$limit[1];

the first time: limit 0,15
and the second time: limit 16,30


the problem is the first time I am getting 15 rows returned (as expected)
the second query of select gallery_url,description from members limit 16,30
is returning 17 rows!!

I've even tried it within phpmyadmin and its giving me 17 rows....what am I
missing here?

Thanks,
Ryan

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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux