Commit f17f18c4 authored by alban's avatar alban
Browse files

[enh] db_mysql : adds exceptions

parent 6bf96240
......@@ -159,6 +159,13 @@ class DB_Sql {
$this->Row = 0;
$this->Errno = mysql_errno();
$this->Error = mysql_error();
if( 0 != $this->Errno ){
if( defined("THROW_EXCEPTIONS") && THROW_EXCEPTIONS ){
throw new \Exception("Mysql query failed : $this->Error");
}
$this->halt("SQL Error: ".$Query_String);
return FALSE;
}
if (!$this->Query_ID) {
$this->halt("Invalid SQL: ".$Query_String);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment