Why did pdo execute return true, to indicate that there was an error in this line?

$op = Db::pdo()->prepare($sql);
$result = $op->execute($execute);      
var_dump($result);
if ($result) {
    return $op->$resultMode();
}

error message:
Fatal error: Uncaught Error: Call to a member function execute () on boolean in xxxxxxxxxx
Error: Call to a member function execute () on boolean in xxxxxxxxx

then I use $op- > errorCode () to get 00000, indicating that the also successful
errorinfo can"t get the mysql error message. What"s going on?

add:
the sql statement goes like this: normally, name = "qq", but I changed" qq" to *
. The problem is that errorinfo can"t get the error message of mysql either

.
Php
Jul.12,2021

if you call the execute method on the boolean type, there is only one case. Prepare returned false causing $op to be false. Take a look at your $sql

Menu