omitting 'INSERT INTO table col=val' for pgsql-compatibility

This commit is contained in:
Ralf Becker 2001-07-19 23:00:51 +00:00
parent 58d7129099
commit 1db9edc55e

View File

@ -237,23 +237,23 @@
{ {
$val = addslashes($val); $val = addslashes($val);
} }
if ($query) $query .= ','; $cols .= ($cols ? ',' : '').$key;
$query .= "$key='$val'"; $vals .= ($vals ? ',' : '')."'$val'";
$query .= ($query ? ',' : '')."$key='$val'";
} }
} }
if ($values['info_id']) if ($values['info_id'])
{ {
$query = 'update phpgw_infolog set '.$query.' where info_id=\'' . $query = "UPDATE phpgw_infolog SET $query where info_id='".$values['info_id']."'";
$values['info_id'] .'\'';
} }
else else
{ {
$query = 'insert INTO phpgw_infolog set '.$query; $query = "INSERT INTO phpgw_infolog ($cols) VALUES ($vals)";
/* /*
* need to set $this->data['info_id'] with assigned autoincrement id * need to set $this->data['info_id'] with assigned autoincrement id
* now data will be rereaded * now data will be rereaded
*/ */
} }
$this->db->query($query,__LINE__,__FILE__); $this->db->query($query,__LINE__,__FILE__);
} }