Release Template files
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
include_once '../config/constants.php';
|
||||
|
||||
class DBTableObject
|
||||
{
|
||||
// database connection and table name
|
||||
protected $conn;
|
||||
protected $table_name = "";
|
||||
protected $array_key = "";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// constructor with $db as database connection
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->conn = $db;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
public function toArray () : array
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
public function getResultArray ($status, $message) : array
|
||||
{
|
||||
return array (
|
||||
"status" => $status,
|
||||
"message" => $message,
|
||||
$this->array_key => $this->toArray()
|
||||
);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
public function executeQuery ($query)
|
||||
{
|
||||
$stmt = $this->conn->prepare($query);
|
||||
$stmt->execute();
|
||||
return $stmt;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user