#756 [NEW]: limit queries not working in peardb using odbc
| From: | gerry dot rodman at ness-usa dot com | Date: | Sat, 14 Feb 2004 02:14:55 +0000 |
| Subject: | #756 [NEW]: limit queries not working in peardb using odbc | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-25653@lists.php.net to get a copy of this message | ||
From: gerry dot rodman at ness-usa dot com
Operating system: win 2003
PHP version: 5CVS-2004-02-13 (dev)
PHP Bug Type: Bug System
Bug description: limit queries not working in peardb using odbc
Description:
------------
Running a limit query return all of the records in a table, not just the
requested records. As of RC3 this code was working (only returning the
request rows). Now the same limit query returns all of the rows. This
bug happens using both MS Access (2003) and MS SQL.
To reproduce: Create or use and existing mdb,system dsn, and data table.
The table should have more then 5 records.
Plug in repective values in included code and run.
Reproduce code:
---------------
<html>
<body>
<?
require_once 'DB.php';
$user = ''; // leave blank unless mdb is secured
$pass = ''; // leave blank unless mdb is secured
$protocol = 'odbc'; // leave as is
$db_name = 'YOUR_DSN_NAME'; // change to System DSN
$dsn = $protocol . "://" . $user . ":" . $pass . "@" . $db_name;
$db = DB::connect($dsn);
if (DB::isError($db))
{
die ($db->getDebugInfo());
}
$sql = "select * from YOUR_TABLE"; // change to match your
table
$start = 3;
$count = 2;
$rs = $db->limitQuery($sql,$start,$count);
while ($row = $rs->fetchRow(DB_FETCHMODE_OBJECT)) {
echo $row->YOUR_FIELD . "<br>"; // change field name to match
your table
}
?>
</body>
</html>
Expected result:
----------------
Should only see rows 3-4
Actual result:
--------------
Will see all rows
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=756&edit=1
--