From 3f0f7ab1a5cbbdbc08315adf309556ab7c2153f5 Mon Sep 17 00:00:00 2001 From: luis daniel lucio quiroz Date: Sat, 21 Jun 2014 05:22:45 +0000 Subject: [PATCH] missing a connect verification --- resources/classes/database.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/classes/database.php b/resources/classes/database.php index b946d4e219..eeb0a8083a 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -346,6 +346,11 @@ include "root.php"; 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); if ($prep_statement) { $prep_statement->execute();