Class it_dbi:
/**
* Delete a record
* Does not destroy query result $this->_result
* @param $query optional query for WHERE, default: delete currently loaded record
* @return number of deleted records
*/
function delete($query = null)
{
$this->_connect();
$result = 0;
if (!$query && $this->_p['keyfield'])
{
$query = array($this->_p['keyfield'] => $this->_key);
$this->clear();
}
if ($query && $this->query("DELETE " . $this->_from($query) . " " . $this->_where($query)))
$result = $this->_affectedrows;
return $result;
}