Here's the 'head' code...
PHP Code:
<?php require_once('Connections/baroquedb.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_content = "SELECT * FROM tbl_textcontent WHERE content_section = 'home' ORDER BY content_order ASC";
$rs_content = mysql_query($query_rs_content, $baroquedb) or die(mysql_error());
$row_rs_content = mysql_fetch_assoc($rs_content);
$totalRows_rs_content = mysql_num_rows($rs_content);
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_labels = "SELECT * FROM tbl_labels ORDER BY label_id ASC";
$rs_labels = mysql_query($query_rs_labels, $baroquedb) or die(mysql_error());
$row_rs_labels = mysql_fetch_assoc($rs_labels);
$totalRows_rs_labels = mysql_num_rows($rs_labels);
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_artists = "SELECT * FROM tbl_artists ORDER BY artist_name ASC";
$rs_artists = mysql_query($query_rs_artists, $baroquedb) or die(mysql_error());
$row_rs_artists = mysql_fetch_assoc($rs_artists);
$totalRows_rs_artists = mysql_num_rows($rs_artists);
$maxRows_rs_leftrelease = 3;
$pageNum_rs_leftrelease = 0;
if (isset($_GET['pageNum_rs_leftrelease'])) {
$pageNum_rs_leftrelease = $_GET['pageNum_rs_leftrelease'];
}
$startRow_rs_leftrelease = $pageNum_rs_leftrelease * $maxRows_rs_leftrelease;
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_leftrelease = "SELECT * FROM tbl_l_release";
$query_limit_rs_leftrelease = sprintf("%s LIMIT %d, %d", $query_rs_leftrelease, $startRow_rs_leftrelease, $maxRows_rs_leftrelease);
$rs_leftrelease = mysql_query($query_limit_rs_leftrelease, $baroquedb) or die(mysql_error());
$row_rs_leftrelease = mysql_fetch_assoc($rs_leftrelease);
if (isset($_GET['totalRows_rs_leftrelease'])) {
$totalRows_rs_leftrelease = $_GET['totalRows_rs_leftrelease'];
} else {
$all_rs_leftrelease = mysql_query($query_rs_leftrelease);
$totalRows_rs_leftrelease = mysql_num_rows($all_rs_leftrelease);
}
$totalPages_rs_leftrelease = ceil($totalRows_rs_leftrelease/$maxRows_rs_leftrelease)-1;
$maxRows_rs_rightrelease = 3;
$pageNum_rs_rightrelease = 0;
if (isset($_GET['pageNum_rs_rightrelease'])) {
$pageNum_rs_rightrelease = $_GET['pageNum_rs_rightrelease'];
}
$startRow_rs_rightrelease = $pageNum_rs_rightrelease * $maxRows_rs_rightrelease;
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_rightrelease = "SELECT * FROM tbl_r_release";
$query_limit_rs_rightrelease = sprintf("%s LIMIT %d, %d", $query_rs_rightrelease, $startRow_rs_rightrelease, $maxRows_rs_rightrelease);
$rs_rightrelease = mysql_query($query_limit_rs_rightrelease, $baroquedb) or die(mysql_error());
$row_rs_rightrelease = mysql_fetch_assoc($rs_rightrelease);
if (isset($_GET['totalRows_rs_rightrelease'])) {
$totalRows_rs_rightrelease = $_GET['totalRows_rs_rightrelease'];
} else {
$all_rs_rightrelease = mysql_query($query_rs_rightrelease);
$totalRows_rs_rightrelease = mysql_num_rows($all_rs_rightrelease);
}
$totalPages_rs_rightrelease = ceil($totalRows_rs_rightrelease/$maxRows_rs_rightrelease)-1;
mysql_select_db($database_baroquedb, $baroquedb);
$query_ts_ticker1 = "SELECT * FROM tbl_ticker WHERE ticker_id = 1";
$ts_ticker1 = mysql_query($query_ts_ticker1, $baroquedb) or die(mysql_error());
$row_ts_ticker1 = mysql_fetch_assoc($ts_ticker1);
$totalRows_ts_ticker1 = mysql_num_rows($ts_ticker1);
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_ticker2 = "SELECT * FROM tbl_ticker WHERE ticker_id = 2";
$rs_ticker2 = mysql_query($query_rs_ticker2, $baroquedb) or die(mysql_error());
$row_rs_ticker2 = mysql_fetch_assoc($rs_ticker2);
$totalRows_rs_ticker2 = mysql_num_rows($rs_ticker2);
mysql_select_db($database_baroquedb, $baroquedb);
$query_rs_ticker3 = "SELECT * FROM tbl_ticker WHERE ticker_id = 3";
$rs_ticker3 = mysql_query($query_rs_ticker3, $baroquedb) or die(mysql_error());
$row_rs_ticker3 = mysql_fetch_assoc($rs_ticker3);
$totalRows_rs_ticker3 = mysql_num_rows($rs_ticker3);
?>
Bookmarks