Compare commits

..

No commits in common. "master" and "3.5.9" have entirely different histories.

View file

@ -35,7 +35,7 @@
*/
private function throw_if_no_table() {
if (!isset($this->table)) {
if (!$this->table) {
throw new Exception("No table name defined");
}
}
@ -268,14 +268,9 @@
$this->throw_if_no_table();
// Set DELETE WHERE conditions from arguments
if ($conditions) {
$this->where(...$conditions);
}
// Get array of SQL WHERE string and filter values
$filter_sql = !is_null($this->filter_sql) ? " WHERE {$this->filter_sql}" : "";
$sql = "DELETE FROM `{$this->table}`{$filter_sql}";
$sql = "DELETE FROM `{$this->table}` WHERE {$this->filter_sql}";
return $this->execute_query($sql, self::to_list_array($this->filter_values));
}