Update database.php
This commit is contained in:
parent
3027bdf9df
commit
03210fe78f
|
|
@ -351,14 +351,14 @@ include "root.php";
|
||||||
|
|
||||||
// Use this function to execute complex queries
|
// Use this function to execute complex queries
|
||||||
public function execute(){
|
public function execute(){
|
||||||
$sql = $this->sql;
|
|
||||||
//echo $sql;
|
|
||||||
//connect to the database if needed
|
//connect to the database if needed
|
||||||
if (!$this->db) {
|
if (!$this->db) {
|
||||||
$this->connect();
|
$this->connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
//get data from the database
|
//get data from the database
|
||||||
$prep_statement = $this->db->prepare($sql);
|
$prep_statement = $this->db->prepare($this->sql);
|
||||||
if ($prep_statement) {
|
if ($prep_statement) {
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
return $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
return $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue