"allow to insert rows with the auto-id specified"

This commit is contained in:
Ralf Becker 2008-04-27 20:05:04 +00:00
parent a3a7503c0f
commit d58ddd9999

View File

@ -489,14 +489,11 @@ class so_sql
$data = $keys;
$keys = False;
}
if (!$this->autoinc_id) // always try an insert if we have no autoinc_id, as we dont know if the data exists
// always try an insert if we have no autoinc_id, as we dont know if the data exists
if (!$this->autoinc_id || !$this->db->update($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app) || !$this->db->affected_rows())
{
$this->db->insert($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app);
}
else
{
$this->db->update($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app);
}
}
$this->db2data();