first PDO commit. make connection in static-config, use in /devices/

git-svn-id: http://www.observium.org/svn/observer/trunk@2272 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-10 10:34:51 +00:00
parent 8c840da62d
commit 585e69c826
2 changed files with 17 additions and 11 deletions
+7
View File
@@ -939,6 +939,13 @@ if (!$observium_link)
}
$observium_db = mysql_select_db($config['db_name'], $observium_link);
try {
$db = new PDO('mysql:host='.$config['db_host'].';dbname='.$config['db_name'], $config['db_user'], $config['db_pass']);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
# Set some times needed by loads of scripts (it's dynamic, so we do it here!)
$now = time();