Эх сурвалжийг харах

missing a connect verification

luis daniel lucio quiroz 11 жил өмнө
parent
commit
01affa027f

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