|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-07 02:17 UTC] mjsabby at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
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