Manage_SQL : improve cosmetic + add error function

This commit is contained in:
Dany De Bontridder 2017-06-27 19:46:23 +02:00
parent cbb47f19e4
commit 52d905c275
5 changed files with 149 additions and 52 deletions

View file

@ -95,8 +95,7 @@ abstract class Noalyss_SQL
*/
public function save()
{
$pk=$this->primary_key;
$count=$this->cn->get_value('select count(*) from '.$this->table.' where '.$this->primary_key.'=$1',array($this->$pk));
$count = $this->exist();
if ($count == 0)
$this->insert();