|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-27 08:42 UTC] hellower at nate dot com
[2005-11-27 19:23 UTC] tony2001@php.net
[2016-03-08 01:36 UTC] sixd@php.net
-Package: PDO related
+Package: PDO OCI
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 15:00:01 2025 UTC |
Description: ------------ when I use "ROWNUM" as bind variable name, the query result set doesn't appeared. db: oracle 8.1.7.4 db os: aix 5.3 webserver: apache 2.0.55 webserver os: winows 2000 php : 5.1.0 Reproduce code: --------------- <?php $dbh = new PDO("oci:dbname=sslgm166_8174", 'XXX', 'XXX',array(PDO::ATTR_PERSISTENT => true)); echo "<pre>"; $sql = 'select * from tab where rownum < :ROWNU'; $sth = $dbh->prepare($sql); $sth->execute(array(':ROWNU' => 2)); $result = $sth->fetchAll(); print_r($result); echo "<hr>"; $sql = 'select * from tab where rownum < :ROWNUM'; $sth = $dbh->prepare($sql); $sth->execute(array(':ROWNUM' => 2)); $result = $sth->fetchAll(); print_r($result); echo "</pre>"; ?> Expected result: ---------------- Array ( [0] => Array ( [TNAME] => CREDITS [0] => CREDITS [TABTYPE] => TABLE [1] => TABLE [CLUSTERID] => [2] => ) ) ----------------------------------------- Array ( [0] => Array ( [TNAME] => CREDITS [0] => CREDITS [TABTYPE] => TABLE [1] => TABLE [CLUSTERID] => [2] => ) ) Actual result: -------------- Array ( [0] => Array ( [TNAME] => CREDITS [0] => CREDITS [TABTYPE] => TABLE [1] => TABLE [CLUSTERID] => [2] => ) ) ----------------------------------------- Array <------------------- EMPTY ARRAY !!! ( )