maxdb_stmt_error
maxdb_stmt->error
Returns a string description for last statement error
&reftitle.description;
Procedural style:
stringmaxdb_stmt_error
resourcestmt
Object oriented style (property):
stmt
stringerror
For the statement specified by stmt, maxdb_stmt_error
returns a containing the error message for the most recently invoked statement function that
can succeed or fail.
&reftitle.returnvalues;
A string that describes the error. An empty string if no error occurred.
&reftitle.examples;
Object oriented style
query("CREATE TABLE temp.mycity LIKE hotel.city");
$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city");
$query = "SELECT name, zip FROM temp.mycity ORDER BY name";
if ($stmt = $maxdb->prepare($query)) {
/* drop table */
$maxdb->query("DROP TABLE temp.mycity");
/* execute query */
$stmt->execute();
printf("Error: %s.\n", $stmt->error);
/* close statement */
$stmt->close();
}
/* close connection */
$maxdb->close();
?>
]]>
Procedural style
]]>
&example.outputs.similar;
Error: POS(23) Unknown table name:MYCITY.
]]>
&reftitle.seealso;
maxdb_stmt_errno
maxdb_stmt_sqlstate