author | Dan Fuhry <dan@enanocms.org> |
Sat, 23 Feb 2013 14:26:05 -0500 | |
changeset 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(); |