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->connected = 1;
|
||||||
$this->ok = 1;
|
$this->ok = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->connected = 0;
|
$this->connected = 0;
|
||||||
$this->ok = 0;
|
$this->ok = 0;
|
||||||
@@ -101,28 +101,24 @@ class DoliDb {
|
|||||||
|
|
||||||
// Si connexion serveur ok et si connexion base demand<6E>e, on essaie connexion base
|
// Si connexion serveur ok et si connexion base demand<6E>e, on essaie connexion base
|
||||||
|
|
||||||
if ($this->connected && $name)
|
if ($this->connected && $name)
|
||||||
{
|
{
|
||||||
|
if ($this->select_db($name) == 1)
|
||||||
if ($this->select_db($name) == 1)
|
{
|
||||||
{
|
$this->database_selected = 1;
|
||||||
$this->database_selected = 1;
|
$this->ok = 1;
|
||||||
$this->ok = 1;
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
$this->database_selected = 0;
|
||||||
$this->database_selected = 0;
|
$this->ok = 0;
|
||||||
$this->ok = 0;
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
}
|
{
|
||||||
else
|
// Pas de selection de base demand<6E>e, ok ou ko
|
||||||
{
|
$this->database_selected = 0;
|
||||||
// Pas de selection de base demand<6E>e, mais tout est ok
|
}
|
||||||
|
|
||||||
$this->database_selected = 0;
|
|
||||||
$this->ok = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->ok;
|
return $this->ok;
|
||||||
}
|
}
|
||||||
@@ -458,7 +454,7 @@ class DoliDb {
|
|||||||
|
|
||||||
function last_insert_id()
|
function last_insert_id()
|
||||||
{
|
{
|
||||||
return mysql_insert_id();
|
return mysql_insert_id($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -468,7 +464,7 @@ class DoliDb {
|
|||||||
|
|
||||||
function affected_rows()
|
function affected_rows()
|
||||||
{
|
{
|
||||||
return mysql_affected_rows();
|
return mysql_affected_rows($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user