Fix: Corrections sur gestion erreurs a l'install

This commit is contained in:
Laurent Destailleur
2005-11-03 23:16:41 +00:00
parent 49dbabe689
commit 7a3b7633dd
2 changed files with 158 additions and 101 deletions

View File

@@ -72,6 +72,16 @@ class DoliDb
$this->transaction_opened=0;
//print "Name DB: $host,$user,$pass,$name<br>";
if (! function_exists("pg_connect"))
{
$this->connected = 0;
$this->ok = 0;
$this->error="Pgsql PHP functions are not available in this version of PHP";
dolibarr_syslog("DoliDB::DoliDB : Pgsql PHP functions are not available in this version of PHP");
return $this->ok;
}
if (! $host)
{
$this->connected = 0;
@@ -149,7 +159,7 @@ class DoliDb
*/
function connect($host, $login, $passwd, $name)
{
$con_string = "host=$host dbname=$name user=$login password=$passwd ";
$con_string = "host=$host dbname=$name user=$login password=$passwd";
$this->db = pg_connect($con_string);
return $this->db;
}