Manage_SQL : improve cosmetic + add error function
This commit is contained in:
parent
cbb47f19e4
commit
52d905c275
5 changed files with 149 additions and 52 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue