maxdb_stmt_error
maxdb_stmt->error
Returns a string description for last statement error
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.
Return values
A string that describes the error. An empty string if no error occurred.
See also
maxdb_stmt_errno,
maxdb_stmt_sqlstate
Example
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
]]>
The above examples would produce the following output:
Error: POS(23) Unknown table name:MYCITY.
]]>