diff --git a/resources/classes/database.php b/resources/classes/database.php index 6a42876d2e..30463b0a29 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -351,14 +351,14 @@ include "root.php"; // Use this function to execute complex queries public function execute(){ - $sql = $this->sql; - //echo $sql; + //connect to the database if needed if (!$this->db) { $this->connect(); } + //get data from the database - $prep_statement = $this->db->prepare($sql); + $prep_statement = $this->db->prepare($this->sql); if ($prep_statement) { $prep_statement->execute(); return $prep_statement->fetchAll(PDO::FETCH_ASSOC);