diff options
author | 2018-01-29 16:46:39 -0500 | |
---|---|---|
committer | 2018-01-29 16:46:39 -0500 | |
commit | 0c00dcb46e650589a387bd042735669402842468 (patch) | |
tree | a64d966f5ad785031b1f606ab3a765faa215d995 | |
parent | Remove the unused php/lib/list.php (diff) | |
download | bouncer-0c00dcb46e650589a387bd042735669402842468.tar.gz bouncer-0c00dcb46e650589a387bd042735669402842468.tar.bz2 bouncer-0c00dcb46e650589a387bd042735669402842468.zip |
Bug fixes for some typos
-rw-r--r-- | php/lib/db.php | 6 | ||||
-rw-r--r-- | 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 "); } + +} |