BUG : dblayer : don't raise an exception when re-inserting unique record
dblayer : add more unit tests git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1850 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
12
dblayer.php
12
dblayer.php
@@ -398,7 +398,7 @@ class dblayer extends PDO
|
||||
}
|
||||
// If there is only the primary key, there is no chance to have a
|
||||
// conflict
|
||||
if ($updatekey !== false && count ($select) >= 2)
|
||||
if ($updatekey === false && count ($select) >= 2)
|
||||
{
|
||||
$rc = $this->read ($select, array ($this->primary));
|
||||
if (count ($rc) > 0)
|
||||
@@ -580,7 +580,15 @@ class dblayer extends PDO
|
||||
throw new Exception ("TO BE DEVELOPPED : ".$this->fields[$key][0], 500);
|
||||
}
|
||||
|
||||
$st->execute ();
|
||||
try
|
||||
{
|
||||
$st->execute ();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo "dblayer execute exception : ".$e->getMessage()."\n";
|
||||
exit;
|
||||
}
|
||||
return $this->db->lastInsertId();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user