author | Dan Fuhry <dan@enanocms.org> |
Sat, 23 Feb 2013 14:26:38 -0500 | |
changeset 9 | f4bf6556fb9f |
parent 8 | f68fdcc18df9 |
permissions | -rw-r--r-- |
8 | 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(); |