Le code erreur errno du gestionnaire de base renvoi 0 plutot que DB_ERROR_0 si pas d'erreur

This commit is contained in:
Laurent Destailleur 2005-09-09 20:10:43 +00:00
parent b283bdf96a
commit c8a4194ceb
2 changed files with 4 additions and 2 deletions

View File

@ -507,7 +507,8 @@ class DoliDb
if (isset($this->errorcode_map[mysql_errno($this->db)])) { if (isset($this->errorcode_map[mysql_errno($this->db)])) {
return $this->errorcode_map[mysql_errno($this->db)]; return $this->errorcode_map[mysql_errno($this->db)];
} }
return 'DB_ERROR_'.mysql_errno($this->db); $errno=mysql_errno($this->db);
return ($errno?'DB_ERROR_'.$errno:'0');
} }
} }

View File

@ -503,7 +503,8 @@ class DoliDb
return $code; return $code;
} }
} }
return 'DB_ERROR'; $errno=pg_last_error($this->db);
return ($errno?'DB_ERROR':'0');
} }
/** /**