浏览代码

missing a connect verification

luis daniel lucio quiroz 11 年之前
父节点
当前提交
01affa027f
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      resources/classes/database.php

+ 5 - 0
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();