Use the connect method in the constructor.

This commit is contained in:
markjcrane
2016-04-16 00:27:24 -06:00
parent a2b6f24a36
commit 09d304a1aa
+1 -3
View File
@@ -54,9 +54,7 @@ if (!class_exists('scripts')) {
//connect to the database if not connected //connect to the database if not connected
require_once "resources/classes/database.php"; require_once "resources/classes/database.php";
$database = new database; $database = new database;
if (!$this->db) { $database->connect();
$database->connect();
}
$this->db = $database->db; $this->db = $database->db;
$this->db_type = $database->type; $this->db_type = $database->type;
$this->db_name = $database->db_name; $this->db_name = $database->db_name;