public function delete($table, $where, $where_format = null)
{
if (!is_array($where)) {
return false;
}
$wheres = [];
$where_formats = $where_format = (array) $where_format;
foreach (array_keys($where) as $field) {
if (!empty($where_format)) {
$form = ($form = array_shift($where_formats)) ? $form : $where_format[0];
} elseif (isset($this->field_types[$field])) {
$form = $this->field_types[$field];
} else {
$form = '%s';
}
$wheres[] = "{$field} = {$form}";
}
$sql = "DELETE FROM {$table} WHERE " . implode(' AND ', $wheres);
return $this->query($this->prepare($sql, $where));
}