First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// Set default timezone
|
||||
date_default_timezone_set("Canada/Pacific");
|
||||
|
||||
$currentDBMode = "Previous";
|
||||
require "/m/data1/app.hotlunches.net/include/config.php";
|
||||
|
||||
//connect to the database..
|
||||
$_DB = mysql_connect($db_host,$db_uname,$db_pass)
|
||||
or die("Cannot connect to database host: " . mysql_error());
|
||||
mysql_select_db($db_dbname)
|
||||
or die("The \"$db_dbname\" database does not exist: " . mysql_error());
|
||||
|
||||
|
||||
// Define error-handling sql-query function
|
||||
if (!function_exists('db_query')) {
|
||||
function db_query($query) {
|
||||
$r = db_query($query) or die($query . "<BR><BR>" . mysql_error());
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// sql query function to return a single row
|
||||
if (!function_exists('db_getVal')) {
|
||||
function db_getVal($query) {
|
||||
$r = db_query($query);
|
||||
if (db_num_rows($r) == 1) {
|
||||
$data = mysql_fetch_row($r);
|
||||
if (count($data) == 1) list($data) = $data;
|
||||
}
|
||||
else {
|
||||
$data = '';
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
// Set collation
|
||||
db_query("SET NAMES 'utf8'");
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user