diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 622b8ddea2..6388676828 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -539,10 +539,11 @@ /* private: error handling */ function halt($msg, $line = '', $file = '') { + $this->Error = @mysql_error($this->Link_ID); // need to be BEFORE unlock, + $this->Errno = @mysql_errno($this->Link_ID); // else we get its error or none + $this->unlock(); /* Just in case there is a table currently locked */ - $this->Error = @mysql_error($this->Link_ID); - $this->Errno = @mysql_errno($this->Link_ID); if($this->Halt_On_Error == 'no') { return;