File updates

This commit is contained in:
Miguel Nogueira 2018-06-08 20:12:01 +00:00
parent c3f882960c
commit 437d81838a
1 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@ class Application
{
private $database = [];
private $db;
private static $db;
public function __construct()
{
@ -22,15 +22,17 @@ class Application
$username = $this->database['username'];
$password = $this->database['password'];
$this->db = \ParagonIE\EasyDB\Factory::create($dsn, $username, $password);
$instance = \ParagonIE\EasyDB\Factory::create($dsn, $username, $password);
self::$db = $instance;
}
public function Exists($Table, $IDRowColumnName, $SearchValue)
{
$exists = $db->cell(
"SELECT count(ID) FROM $Table WHERE $IDRowColumnName = ?",
$SearhValue