|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2021-05-13 18:33 UTC] cmb@php.net
[2021-05-14 11:05 UTC] git@php.net
[2021-05-14 11:05 UTC] git@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ When executing a prepared statement in non-emulated mode PDO reports an error, but only with the code without the actual error message text. Test script: --------------- <?php $pdo = new \PDO("mysql:host=localhost;dbname=test;charset=utf8mb4", 'user', 'password', [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_EMULATE_PREPARES => false ]); $sql = "SELECT `foo` FROM `bar` WHERE `foo` = :par"; $stmt = $pdo->prepare($sql); $stmt->execute(); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); Expected result: ---------------- Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2031 No data supplied for parameters in prepared statement in Actual result: -------------- Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2031 in // Notice the text is missing between error code and the "in"