From d11c2f66bf09b05a1f3764f7397ffd01086edd15 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Tue, 1 Sep 2020 12:25:15 +0200 Subject: allow to add a suffix after INSERT (for ON FOO sql syntax) --- it_dbi.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index dd0fb14..0dfde04 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -771,7 +771,7 @@ function iterate() * @param $tags key => value pairs to set * @return true for success, false for failure (e.g. duplicate entry for key) */ -function insert($tags = array(), $command = "INSERT") +function insert($tags = array(), $command = "INSERT", $suffix = "") { $this->_connect(); @@ -784,7 +784,7 @@ function insert($tags = array(), $command = "INSERT") $values = $this->_values($tags, "insert"); - if ($result = $this->query($query = "$command INTO {$this->_p['table']} " . $values)) + if ($result = $this->query($query = "$command INTO {$this->_p['table']} " . $values . $suffix)) { $id = ($this->_p['autoincrement'] && !isset($tags[$this->_p['keyfield']])) ? $this->_insertid : $tags[$this->_p['keyfield']]; if ($this->_p['keyfield'] && !$this->read($id) && $this->_p['safety']) -- cgit v1.2.3