diff --git a/core/database.class.php b/core/database.class.php index cfb2abaf..9b2c70c3 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -325,15 +325,20 @@ class Database { public function execute($query, $args=array()) { try { $stmt = $this->db->prepare($query); - foreach($args as $name=>$value) { - if(is_numeric($value)) { - $stmt->bindValue(":$name", $value, PDO::PARAM_INT); - } - else { - $stmt->bindValue(":$name", $value, PDO::PARAM_STR); + if (!array_key_exists(0, $args)) { + foreach($args as $name=>$value) { + if(is_numeric($value)) { + $stmt->bindValue(":$name", $value, PDO::PARAM_INT); + } + else { + $stmt->bindValue(":$name", $value, PDO::PARAM_STR); + } } + $stmt->execute(); + } + else { + $stmt->execute($args); } - $stmt->execute(); return $stmt; } catch(PDOException $pdoe) {