I am trying to unravel MySqli and am confused by the error message. I use the return value of the MySQLi prepare statement to detect errors when executing SQL, for example:
$stmt_test = $mysqliDatabaseConnection->stmt_init(); if($stmt_test->prepare("INSERT INTO testtable VALUES (23,44,56)")) { $stmt_test->execute(); $stmt_test->close(); } else echo("Statement failed: ". $stmt_test->error . "<br>");
But, is the return value of the preparation statement only an error detection in the execution of the SQL statement and no error detection of the execution? If this is the case, I should therefore change my progress bar so that they display errors:
if($stmt_test->execute()) $errorflag=true;
And then, to be safe, I also have to do the following after executing the instruction:
if($stmt_test->errno) {$errorflag=true;}
... Or was I fine and the return value in the MySQLi preparation statement fixes all errors related to the full execution of the query that it defines?
Thanks C
php mysql mysqli prepared-statement
Columbo Mar 31 '10 at 11:43 2010-03-31 11:43
source share