packages/ssoinabox-webui/root/usr/local/share/ssoinabox/htdocs/includes/db.php
changeset 8 f68fdcc18df9
equal deleted inserted replaced
5:cdd708efa505 8:f68fdcc18df9
       
     1 <?php
       
     2 
       
     3 global $db;
       
     4 
       
     5 function db_setup()
       
     6 {
       
     7 	global $db, $mysql;
       
     8 	
       
     9 	$db = new PDO("mysql:host={$mysql['host']};user={$mysql['user']};{$mysql['password']};dbname={$mysql['dbname']}");
       
    10 }
       
    11 
       
    12 function db_prepare($sql)
       
    13 {
       
    14 	global $db;
       
    15 	
       
    16 	$st = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
       
    17 	return $st;
       
    18 }
       
    19 
       
    20 db_setup();