From 437d81838a9f57afa2e82973dae53c45450cd6e7 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Fri, 8 Jun 2018 20:12:01 +0000 Subject: [PATCH] File updates --- source/dbtools/Application.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dbtools/Application.php b/source/dbtools/Application.php index 5d3925f..7505023 100644 --- a/source/dbtools/Application.php +++ b/source/dbtools/Application.php @@ -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