Add error reporting via sql_sqlstate() and sql_error()