aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-01-29 16:46:39 -0500
committerBrian Evans <grknight@gentoo.org>2018-01-29 16:46:39 -0500
commit0c00dcb46e650589a387bd042735669402842468 (patch)
treea64d966f5ad785031b1f606ab3a765faa215d995 /php/lib/db.php
parentRemove the unused php/lib/list.php (diff)
downloadbouncer-0c00dcb46e650589a387bd042735669402842468.tar.gz
bouncer-0c00dcb46e650589a387bd042735669402842468.tar.bz2
bouncer-0c00dcb46e650589a387bd042735669402842468.zip
Bug fixes for some typos
Diffstat (limited to 'php/lib/db.php')
-rw-r--r--php/lib/db.php6
1 files changed, 3 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);
}