php.net |  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
Votes:1
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mjsabby at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-07 01:31 UTC] mjsabby at gmail dot com
Description:
------------
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:
---------------
<?php

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) {
  die($e->getMessage());
}

$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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-07 02:17 UTC] mjsabby at gmail dot com
See Bug #38737
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Feb 25 20:01:24 2021 UTC