Skip to content
Snippets Groups Projects
Commit a6c8912c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Qual: Meilleur gestion erreur si fonctions mysql non dispo sur le php

parent 5f245b7f
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,16 @@ class DoliDb ...@@ -90,6 +90,16 @@ class DoliDb
$this->transaction_opened=0; $this->transaction_opened=0;
//print "Name DB: $host,$user,$pass,$name<br>"; //print "Name DB: $host,$user,$pass,$name<br>";
if (! function_exists(mysql_connect))
{
$this->connected = 0;
$this->ok = 0;
$this->error="Mysql PHP functions are not available in this version of PHP";
dolibarr_syslog("DoliDB::DoliDB : Mysql PHP functions are not available in this version of PHP");
return $this->ok;
}
if (! $host) if (! $host)
{ {
$this->connected = 0; $this->connected = 0;
...@@ -161,7 +171,7 @@ class DoliDb ...@@ -161,7 +171,7 @@ class DoliDb
*/ */
function connect($host, $login, $passwd, $name) function connect($host, $login, $passwd, $name)
{ {
$this->db = @mysql_connect($host, $login, $passwd); $this->db = mysql_connect($host, $login, $passwd);
//print "Resultat fonction connect: ".$this->db; //print "Resultat fonction connect: ".$this->db;
return $this->db; return $this->db;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment