packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/db.php
author Dan Fuhry <dan@enanocms.org>
Sat, 23 Feb 2013 14:26:38 -0500
changeset 9 f4bf6556fb9f
parent 8 f68fdcc18df9
permissions -rw-r--r--
Merged

<?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();