summaryrefslogtreecommitdiffstats
path: root/Db.class.php
diff options
context:
space:
mode:
authorJamie Cressey <jamiecressey89@googlemail.com>2014-07-05 16:14:09 -0400
committerJamie Cressey <jamiecressey89@googlemail.com>2014-07-05 16:14:09 -0400
commit9737cfe130e4a7a56eaa91ba0835efdedb9bceec (patch)
tree6ae1902ef09943295ecb3930fab2c7e10b3ba9ac /Db.class.php
parent66e72318fbac670abe640d62eaf0c87ef9498fb3 (diff)
downloadphp-mysql-pdo-database-class-9737cfe130e4a7a56eaa91ba0835efdedb9bceec.zip
php-mysql-pdo-database-class-9737cfe130e4a7a56eaa91ba0835efdedb9bceec.tar.gz
php-mysql-pdo-database-class-9737cfe130e4a7a56eaa91ba0835efdedb9bceec.tar.bz2
Clean up for my needs
Diffstat (limited to 'Db.class.php')
-rw-r--r--Db.class.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/Db.class.php b/Db.class.php
index 9040728..7494a7a 100644
--- a/Db.class.php
+++ b/Db.class.php
@@ -52,12 +52,12 @@ class DB
*/
private function Connect()
{
- $this->settings = parse_ini_file("settings.ini.php");
- $dsn = 'mysql:dbname='.$this->settings["dbname"].';host='.$this->settings["host"].'';
+ global $settings;
+ $dsn = 'mysql:dbname='.$settings["dbname"].';host='.$settings["dbhost"].'';
try
{
# Read settings from INI file, set UTF8
- $this->pdo = new PDO($dsn, $this->settings["user"], $this->settings["password"], array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
+ $this->pdo = new PDO($dsn, $ettings["dbuser"], $settings["dbpass"], array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
# We can now log any exceptions on Fatal error.
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);