Is this error checking necessary?
Posted: Mon Oct 23, 2006 6:56 pm
Hello everyone
Is it worth doing this to check whether MySQL inserts have completed successfully?
Normally I guess MySQL gives its own error message if something goes wrong so I guess this is redundant, but just wondered what you guys thought??!
Thanks
Ben
Is it worth doing this to check whether MySQL inserts have completed successfully?
Code: Select all
// CHECK FOR MYSQL ERROR
if ( mysql_error() != '') {
$sql_error_msg = mysql_error();
$sql_error_code = mysql_errno();
$error = 1;
$error_msg .= "Could not add material log item<br />\nMySQL error. Error code $sql_error_code $sql_error_msg<br />\n";
}Thanks
Ben