packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/db.php
author Dan Fuhry <dan@enanocms.org>
Sat, 23 Feb 2013 14:26:05 -0500
changeset 8 f68fdcc18df9
permissions -rw-r--r--
Started on the database

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