From 7964a8ba3dd041511c483b7f220b6d14d71ef69e Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 22 Jun 2018 12:50:04 +0000 Subject: Initial attempt at data interface. --- www/common.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 www/common.php (limited to 'www/common.php') diff --git a/www/common.php b/www/common.php new file mode 100644 index 0000000..52971eb --- /dev/null +++ b/www/common.php @@ -0,0 +1,28 @@ +. +*/ + +function ConnectDB() +{ + $pdo = new PDO("mysql:host=localhost;dbname={$config["dbname"]}", + $config["dbuser"], $config["dbpassword"]); + $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + return $pdo; +} +?> -- cgit v1.2.3