diff options
-rw-r--r-- | it_dbi.class | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/it_dbi.class b/it_dbi.class index c995d55..3c414f0 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -450,7 +450,7 @@ function _where($params) /** * Internal: Output class name::error message and terminate execution. */ -function _fatal($text) +function _fatal($text, $body = null) { $text = get_class($this).'::'.$text; @@ -460,7 +460,7 @@ function _fatal($text) if ($this->_link && ($res = @mysqli_fetch_row(mysqli_query($this->_link, 'select database()')))) # dont create extra errs $text .= ", DB: " . $res[0]; - it::fatal($text . ", Server: " . $this->_p['server']); + it::fatal(['title' => $text . ", Server: " . $this->_p['server'], 'body' => $body]); /* NOT REACHED */ } @@ -761,11 +761,11 @@ function insert($tags = array(), $command = "INSERT") $set = $this->_set($tags, "insert"); - if ($result = $this->query("$command INTO {$this->_p['table']} " . $set)) + if ($result = $this->query($query = "$command INTO {$this->_p['table']} " . $set)) { $id = ($this->_p['autoincrement'] && !isset($tags[$this->_p['keyfield']])) ? mysqli_insert_id($this->_link) : $tags[$this->_p['keyfield']]; if ($this->_p['keyfield'] && !$this->read($id) && $this->_p['safety']) - $this->_fatal("insert(): can't read record back (key truncated?), id=\"$id\""); + $this->_fatal("insert(): can't read record back (key truncated?), id=\"$id\"", $query); $this->_touchedids[$this->_key] = true; } |