From 0c00dcb46e650589a387bd042735669402842468 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Mon, 29 Jan 2018 16:46:39 -0500 Subject: Bug fixes for some typos --- php/lib/db.php | 6 +++--- php/lib/mirror.php | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/php/lib/db.php b/php/lib/db.php index 6882064..34e49e3 100644 --- a/php/lib/db.php +++ b/php/lib/db.php @@ -7,8 +7,8 @@ class DB { - private $dsn; - private $result; + private static $dbh; + private static $result; /** * Connect to a MySQL database server. * @param string $host db server, defaults to localhost @@ -20,7 +20,7 @@ public static function connect($host='localhost',$user=null,$password=null,$data { if (!empty($host) && isset($user) && isset($password)) { $dsn = "mysql:host={$host}"; - if(!empty($database)) $dsn .= ";database={$database}"; + if(!empty($database)) $dsn .= ";dbname={$database}"; $options = [PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]; static::$dbh = new PDO($dsn, $user, $password, $options); } diff --git a/php/lib/mirror.php b/php/lib/mirror.php index ac3e904..564e33f 100644 --- a/php/lib/mirror.php +++ b/php/lib/mirror.php @@ -530,3 +530,5 @@ public static function get_product_stats() mirror_locations.product_id "); } + +} -- cgit v1.2.3-65-gdbad