php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36032 PDOStatement::fetchSingle()
Submitted: 2006-01-16 15:36 UTC Modified: 2006-01-16 15:49 UTC
From: stloukal at tiscali dot cz Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.2 OS: Linux (FC4; 2.6.11)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stloukal at tiscali dot cz
New email:
PHP Version: OS:

 

 [2006-01-16 15:36 UTC] stloukal at tiscali dot cz
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-16 15:49 UTC] tony2001@php.net
fetchSingle() was renamed to fetchColumn() 8 months ago.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC