|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38736 PDO prepare() or query() always fails, MySQL
Submitted: 2006-09-07 01:31 UTC Modified: 2006-09-07 02:17 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mjsabby at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.6 OS: Fedora Core 5
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.
Block user comment
Status: Assign to:
Bug Type:
From: mjsabby at gmail dot com
New email:
PHP Version: OS:


 [2006-09-07 01:31 UTC] mjsabby at gmail dot com
PHP 5.1.6
MySQL 5.0.19-standard
Fedora Core 5

prepare() or query() alwyas fails, regardless of syntactically correct SQL or not, atleast for MySQL.

MySQL(i) client libraries work perfectly, but the PDO with the exact same query fails.

Reproduce code:

define('DB_DSN', 'mysql:localhost;dbname=xxx');
define('DB_USER', 'xxx');
define('DB_PASS', 'xxx');

try {
  $dbh = new PDO(DB_DSN, DB_USER, DB_PASS);
} catch (PDOException $e) {

$query = $dbh->query("SELECT * FROM users") or echo("BOO");
$prepa = $dbh->prepare("SELECT * FROM users") or echo("BOO2");

$dbh = null;


Expected result:
Run the query


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-07 02:17 UTC] mjsabby at gmail dot com
See Bug #38737
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 14:01:29 2024 UTC