summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 368045b..3ca2fc1 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -625,7 +625,7 @@ function insert($tags = array(), $command = "INSERT")
if ($result = $this->query("$command INTO {$this->_p['table']} " . $set))
{
$id = ($this->_p['autoincrement'] && !isset($tags[$this->_p['keyfield']])) ? mysql_insert_id($this->_link) : $tags[$this->_p['keyfield']];
- if (!$this->read($id) && $this->_p['safety'])
+ if ($this->_p['keyfield'] && !$this->read($id) && $this->_p['safety'])
$this->_fatal("insert(): can't read record back (key truncated?), id=\"$id\"");
}
else