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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 6 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC