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