diff --git a/classes/Db.php b/classes/Db.php index ad7b9171e..a1239dd2a 100644 --- a/classes/Db.php +++ b/classes/Db.php @@ -298,7 +298,8 @@ abstract class DbCore public function delete($table, $where = false, $limit = false, $use_cache = 1) { $this->_result = false; - $res = $this->query('DELETE FROM `'.pSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)$limit : '')); + $sql = 'DELETE FROM `'.pSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)$limit : ''); + $res = $this->query($sql); if ($use_cache AND _PS_CACHE_ENABLED_) Cache::getInstance()->deleteQuery($sql); return $res;