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