packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/db.php
changeset 8 f68fdcc18df9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/db.php	Sat Feb 23 14:26:05 2013 -0500
@@ -0,0 +1,20 @@
+<?php
+
+global $db;
+
+function db_setup()
+{
+	global $db, $mysql;
+	
+	$db = new PDO("mysql:host={$mysql['host']};user={$mysql['user']};{$mysql['password']};dbname={$mysql['dbname']}");
+}
+
+function db_prepare($sql)
+{
+	global $db;
+	
+	$st = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
+	return $st;
+}
+
+db_setup();