diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-11-19 17:27:03 -0500 |
commit | 24503e3abe705acde2df159aeae61be0d009f92e (patch) | |
tree | 8debbd53dcd0db2f5934c5e2af4e697e3787781d /includes/db.php | |
download | fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.gz fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.bz2 fourisland-24503e3abe705acde2df159aeae61be0d009f92e.zip |
Imported sources
Diffstat (limited to 'includes/db.php')
-rwxr-xr-x | includes/db.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/includes/db.php b/includes/db.php new file mode 100755 index 0000000..8cc5449 --- /dev/null +++ b/includes/db.php | |||
@@ -0,0 +1,49 @@ | |||
1 | <?php | ||
2 | /* | ||
3 | 444444444 | ||
4 | 4::::::::4 | ||
5 | 4:::::::::4 | ||
6 | 4::::44::::4 | ||
7 | 4::::4 4::::4 Four Island | ||
8 | 4::::4 4::::4 | ||
9 | 4::::4 4::::4 Written and maintained by Starla Insigna | ||
10 | 4::::444444::::444 | ||
11 | 4::::::::::::::::4 includes/db.php | ||
12 | 4444444444:::::444 | ||
13 | 4::::4 Please do not use, reproduce or steal the | ||
14 | 4::::4 contents of this file without explicit | ||
15 | 4::::4 permission from Hatkirby. | ||
16 | 44::::::44 | ||
17 | 4::::::::4 | ||
18 | 4444444444 | ||
19 | */ | ||
20 | |||
21 | if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} | ||
22 | |||
23 | require('headerproc.php'); | ||
24 | |||
25 | // Make the database connection. | ||
26 | mysql_connect($dbwebhost, $dbwebuser, $dbwebpasswd); | ||
27 | mysql_select_db($dbwebname); | ||
28 | |||
29 | function db_single_select($query) | ||
30 | { | ||
31 | $getitem1 = $query; | ||
32 | $getitem2 = mysql_query($getitem1) or die($getitem1); | ||
33 | $getitem3 = mysql_fetch_array($getitem2); | ||
34 | return $getitem3; | ||
35 | } | ||
36 | |||
37 | function db_multi_select($query, $callback) | ||
38 | { | ||
39 | $getitem1 = $query; | ||
40 | $getitem2 = mysql_query($getitem1) or die($getitem1); | ||
41 | $i=0; | ||
42 | while ($getitem3[$i] = mysql_fetch_array($getitem2)) | ||
43 | { | ||
44 | $callback($getitem3[$i]); | ||
45 | $i++; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | ?> | ||