savagenoob Posted November 16, 2010 Share Posted November 16, 2010 For some odd reason, when I add a snippet of PHP code to a certain page, it whitespaces the whole thing. I have other PHP snippets scattered around already. When I delete it, page is ok, with it, nothing but a grey border, all content is white. Freakin wierd. Here is the code... $day = date('d'); $month = date('m'); $year = date('Y'); $last = last_business_day($year,$month); $lastday = date('d', strtotime($last)); if($day > "15"){ $date2 = date("Y-m-" . $lastday); } else { $date2 = date("Y-m-15"); } $date1= date('Y-m-d'); $time = " 23:59:59"; $date3 = $date2 . $time; $agency = $_SESSION['AGENCY']; $agent = $_SESSION['AGENTNAME']; $query = "SELECT Amount1RS, SUM(BrokerFee), SUM(TotalCollected), SUM(Commission), AVG(BrokerFee), COUNT(ID) FROM accounting WHERE agency = '$agency' AND agent = '$agent' AND Amount1RS = 'New Business' AND Date BETWEEN '$newdate1' AND '$date3'"; $result = mysql_query($query); while($myrow = mysql_fetch_assoc($result)) {//begin of loop $totbroker = $myrow['SUM(BrokerFee)']; $avgbroker = $myrow['AVG(BrokerFee)']; $totcommission = $myrow['SUM(Commission)']; $totproduction = $myrow['SUM(Commission)'] + $myrow['SUM(BrokerFee)']; } $proquery = mysql_query("SELECT COUNT(ID) FROM clients WHERE Status = 'Prospect' AND Agency = '$agency' AND agentname = '$agent'") or die(mysql_error()); $prospects = mysql_fetch_array($proquery); $insquery = mysql_query("SELECT COUNT(ID) FROM clients WHERE Status = 'Insured' AND Agency = '$agency' AND agentname = '$agent'") or die(mysql_error()); $insureds = mysql_fetch_array($insquery); $closing = ($insureds / $prospects) * 100; $closing = floatval($closing); I even put it in teh <head> tag, same result. Anyone encountered this before? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 16, 2010 Share Posted November 16, 2010 It turns white because: You have an error in your code or There is no output to show Quote Link to comment Share on other sites More sharing options...
savagenoob Posted November 16, 2010 Author Share Posted November 16, 2010 Dude, you were right, I put the code on test page and it threw a 500, which is what I am used to. Made a simple mistake from coding late night. Why does it just show blank on this page vs. a 500 error? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 17, 2010 Share Posted November 17, 2010 You can check your server log and see if there is an error there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.