forked from Wavyzz/dolibarr
Fix: Corrige probleme sur fonction last_insert_id
This commit is contained in:
@@ -93,7 +93,7 @@ class DoliDb {
|
||||
$this->connected = 1;
|
||||
$this->ok = 1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->connected = 0;
|
||||
$this->ok = 0;
|
||||
@@ -101,29 +101,25 @@ class DoliDb {
|
||||
|
||||
// Si connexion serveur ok et si connexion base demand<6E>e, on essaie connexion base
|
||||
|
||||
if ($this->connected && $name)
|
||||
{
|
||||
|
||||
if ($this->select_db($name) == 1)
|
||||
{
|
||||
$this->database_selected = 1;
|
||||
$this->ok = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->database_selected = 0;
|
||||
$this->ok = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pas de selection de base demand<6E>e, mais tout est ok
|
||||
|
||||
$this->database_selected = 0;
|
||||
$this->ok = 1;
|
||||
}
|
||||
|
||||
if ($this->connected && $name)
|
||||
{
|
||||
if ($this->select_db($name) == 1)
|
||||
{
|
||||
$this->database_selected = 1;
|
||||
$this->ok = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->database_selected = 0;
|
||||
$this->ok = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pas de selection de base demand<6E>e, ok ou ko
|
||||
$this->database_selected = 0;
|
||||
}
|
||||
|
||||
return $this->ok;
|
||||
}
|
||||
|
||||
@@ -458,7 +454,7 @@ class DoliDb {
|
||||
|
||||
function last_insert_id()
|
||||
{
|
||||
return mysql_insert_id();
|
||||
return mysql_insert_id($this->db);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -468,7 +464,7 @@ class DoliDb {
|
||||
|
||||
function affected_rows()
|
||||
{
|
||||
return mysql_affected_rows();
|
||||
return mysql_affected_rows($this->db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user