Req #37839 [Opn]: Limit of returned rows
| From: | ssufficool@php.net | Date: | Sat, 24 Dec 2011 06:33:09 +0000 |
| Subject: | Req #37839 [Opn]: Limit of returned rows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-166072@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=37839&edit=1
ID: 37839
Updated by: ssufficool@php.net
Reported by: rael at grad dot icmc dot usp dot br
Summary: Limit of returned rows
Status: Open
Type: Feature/Change Request
Package: PDO related
Operating System: Any
PHP Version: 5.1.4
Block user comment: N
Private report: N
New Comment:
This same effect is achievable using the fetch method with the offset argument and limiting the
results in your fetch loop.
It could be argued the offset and limit arguments should be added to the fetchAll() method though.
Previous Comments:
------------------------------------------------------------------------
[2006-06-18 17:17:06] rael at grad dot icmc dot usp dot br
Description:
------------
A PDO method for limit the number of rows returned from a query, independent of the used DBMS. This
feature is available in DBMS abstraction packages, like ADODB (and in Java JDBC too). Something like
this:
function setLimit($limit, $offset);
Reproduce code:
---------------
$con = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$stmt = $con->prepare("SELECT * FROM table");
$stmt->setLimit(10, 2);
Expected result:
----------------
10 tableresults starting from position 2
Actual result:
--------------
Function not exists yet.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=37839&edit=1