|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79808 fetch General error
Submitted: 2020-07-08 08:53 UTC Modified: 2020-07-11 19:34 UTC
From: admin at yurunsoft dot com Assigned:
Status: Not a bug Package: PDO MySQL
PHP Version: 8.0.0alpha1 OS: Linux
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: admin at yurunsoft dot com
New email:
PHP Version: OS:


 [2020-07-08 08:53 UTC] admin at yurunsoft dot com
The bug is only in php8

Test script:
$pdo = new PDO('mysql:host=;port=3306;dbname=db_imi_test;charset=utf8', 'root', 'root');
$stmt = $pdo->query('update tb_article set id = 1 where id = 1');

Expected result:
object(PDOStatement)#2 (1) {
  string(41) "update tb_article set id = 1 where id = 1"

Actual result:
object(PDOStatement)#2 (1) {
  string(40) "update tb_member set id = 1 where id = 1"

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error in /mnt/d/projects/imi/test2.php:5
Stack trace:
#0 /mnt/d/projects/imi/test2.php(5): PDOStatement->fetch()
#1 {main}
  thrown in /mnt/d/projects/imi/test2.php on line 5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-11 19:34 UTC]
-Status: Open +Status: Not a bug
 [2020-07-11 19:34 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is due to the default error mode of PDO is `PDO::ERRMODE_EXCEPTION` now, see:

In previous versions of PHP, you can check it by:


string(5) "HY000"
array(3) {
  string(5) "HY000"

It may seem unreasonable to you, but it is as expected
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 07:01:29 2024 UTC