- Impact
- 9
I have data archived and on the archive.php page uses can select the year and see all the data for that year .. Everything works fine except one year (2008) displays a white /empty page ..
anyone see anything here that may cause that ? //Begin Session
//Generate Query
$year = $_GET['year'];
$month = $_GET['month'];
$state = $_GET['state'];
$city = $_GET['city'];
//Begin Building Query
$Query.= 'SELECT * FROM `prices` WHERE `archive`=\'1\' ';
//Check if they are not empty
if(empty($year) || !is_numeric($year)){ $year = 'allyears'; }
if($year == 'allyears'){ $year = date('Y'); }
if(empty($month) || !is_numeric($month)){ $month = 'allmonths'; }
if(empty($state)){ $state = 'allstates'; }
if(empty($city)){ $city = 'allcitys'; }
//Generate time code
if($year == 'allyears' && $month == 'allmonths'){
//Do not alter query
} else{
if($month == 'allmonths'){
//Display Whole Year
$min = mktime(0,0,0,1,0,$year);
$max = mktime(24, 0, 0, 12, 31, $year);
} else{
//Convert to time stamps
$min = mktime(0, 0, 0, $month, 0, $year);
$lastday = date('t', mktime(0,0,0,$month,2,$year));
$max = mktime(24, 0, 0, $month, $lastday, $year);
}
$Query.= "AND `timestamp`>'$min' AND `timestamp`<'$max' ";
BTW .. It will Display any selected Month ..for 2008 just not the year
Year works for 2007, 2009 , 2010 ..not 2008
}
anyone see anything here that may cause that ? //Begin Session
//Generate Query
$year = $_GET['year'];
$month = $_GET['month'];
$state = $_GET['state'];
$city = $_GET['city'];
//Begin Building Query
$Query.= 'SELECT * FROM `prices` WHERE `archive`=\'1\' ';
//Check if they are not empty
if(empty($year) || !is_numeric($year)){ $year = 'allyears'; }
if($year == 'allyears'){ $year = date('Y'); }
if(empty($month) || !is_numeric($month)){ $month = 'allmonths'; }
if(empty($state)){ $state = 'allstates'; }
if(empty($city)){ $city = 'allcitys'; }
//Generate time code
if($year == 'allyears' && $month == 'allmonths'){
//Do not alter query
} else{
if($month == 'allmonths'){
//Display Whole Year
$min = mktime(0,0,0,1,0,$year);
$max = mktime(24, 0, 0, 12, 31, $year);
} else{
//Convert to time stamps
$min = mktime(0, 0, 0, $month, 0, $year);
$lastday = date('t', mktime(0,0,0,$month,2,$year));
$max = mktime(24, 0, 0, $month, $lastday, $year);
}
$Query.= "AND `timestamp`>'$min' AND `timestamp`<'$max' ";
BTW .. It will Display any selected Month ..for 2008 just not the year
Year works for 2007, 2009 , 2010 ..not 2008
}






