summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2020-09-01 12:25:15 +0200
committerNathan Gass2020-09-01 12:25:15 +0200
commitd11c2f66bf09b05a1f3764f7397ffd01086edd15 (patch)
tree7a5064f45c8338c19e3d24da207a791c479fbc88
parentdfc88cb95226ce20973c0d40e15d53b8950ec233 (diff)
downloaditools-d11c2f66bf09b05a1f3764f7397ffd01086edd15.tar.gz
itools-d11c2f66bf09b05a1f3764f7397ffd01086edd15.tar.bz2
itools-d11c2f66bf09b05a1f3764f7397ffd01086edd15.zip
allow to add a suffix after INSERT (for ON FOO sql syntax)
-rw-r--r--it_dbi.class4
1 files changed, 2 insertions, 2 deletions
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'])