From: stloukal at tiscali dot cz
Operating system: Linux (FC4; 2.6.11)
PHP version: 5.1.2
PHP Bug Type: PDO related
Bug description: PDOStatement::fetchSingle()
Description:
------------
Hello,
I get unexpectable error:
Fatal error: Call to undefined method PDOStatement::fetchSingle() in ...
I compiled PHP 5.1.2 from source with these configure commands:
'./configure' '--prefix=/usr/local'
'--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-mysqli=/usr/local/mysql/bin/mysql_config'
'--with-mysql-sock=/tmp/mysql.sock' '--with-zlib' '--with-zlib-dir'
'--with-bz2' '--with-gd' '--enable-gd' '--enable-gd-native-ttf'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-ttf'
'--with-freetype-dir=/usr/local' '--with-iconv=/usr/local'
'--with-curl=/usr/local' '--enable-track-vars' '--with-gettext'
'--with-config-file-path=/usr/local/apache2/conf' '--enable-trans-id'
'--enable-ftp' '--with-cpdflib=/usr/local' '--enable-mbstring'
'--with-openssl=/usr/local' '--without-pdo-sqlite' '--without-sqlite'
'--with-pdo-mysql=/usr/local/mysql/' '--with-iodbc=/usr/local/'
I have no troubles with any other PDO functions.
Reproduce code:
---------------
<?PHP
try{
$pom = new PDO('mysql:host=localhost;dbname=mydb','user','pass');
$tmp_res = $pom->query('SELECT * FROM u_users');
if($tmp_res)
echo $tmp_res->fetchSingle();
}
catch(PDOException $e){
echo $e->getMessage();
}
unset($pom);
Expected result:
----------------
1
Actual result:
--------------
Above error message
--
Edit bug report at http://bugs.php.net/?id=36032&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36032&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36032&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36032&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36032&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36032&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36032&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36032&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36032&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36032&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36032&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36032&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36032&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36032&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36032&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36032&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36032&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36032&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36032&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36032&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36032&r=mysqlcfg