// Database Connection
include("functions/mysql_db_connect_fnc.php");
// Results Displayed Per Page
$rows_per_page = 12;
// Record To Start At
if(!isset($_GET[current_record])){$_GET[current_record] = 0;}
// Make Sure Current Record Is Never Nagative
if($_GET[current_record] < 0){$_GET[current_record] = 0; $_GET[current_page] = 1;}
// Page To Start At
if(!isset($_GET[current_page])){$_GET[current_page] = 1;}
// Used To Keep Track Of Displayed Message Numbers
$first_record = $_GET[current_record] + 1;
$last_record = $_GET[current_record] + $rows_per_page;
// Select Show Home From Database
$HomeQuery = mysql_query("SELECT * FROM ShowHomes WHERE ShowHomeID = '$_GET[ShowHomeID]'");
$HomeArray = mysql_fetch_assoc($HomeQuery);
$ShowHomeName = strtolower ($HomeArray[Name]);
$ShowHomeName = str_replace(" ", "", $ShowHomeName);
// Query Show Home Photos From Database (Start With Ext Photos)
$PhotoQuery = mysql_query("SELECT * FROM Photos WHERE ShowHomeID = '$_GET[ShowHomeID]' ORDER BY Type ASC LIMIT $_GET[current_record],$rows_per_page");
$MainQuery = mysql_query("SELECT * FROM Photos WHERE ShowHomeID = '$_GET[ShowHomeID]' ORDER BY Type ASC");
$MainPhoto = mysql_fetch_assoc($MainQuery);
// Total Number Of Pages Of Results
$total_result_query = mysql_query("SELECT * FROM Photos WHERE ShowHomeID = '$_GET[ShowHomeID]' ORDER BY Type ASC");
$total_records = mysql_num_rows($total_result_query);
$total_pages = ceil($total_records / $rows_per_page);
?>