Query returning blank page
Posted: Thu May 14, 2009 8:17 pm
Been having issues all night with a bunch of my code and files and am getting really angry, but this one is one I'm most confused about.
It returns a blank page. Turning on error reporting for PHP and for MySQL shows nothing unless I purposefully make something wrong, but leaving it as is just gives me a blank page. What gives?
It returns a blank page. Turning on error reporting for PHP and for MySQL shows nothing unless I purposefully make something wrong, but leaving it as is just gives me a blank page. What gives?
Code: Select all
<?
include ("db_connection");
$query = "SELECT * FROM Events";
$result = MYSQL_QUERY($query) or die('Query Failed');
while ($list = mysql_fetch_assoc($result)) {
$start = $list['Start'];
$end = $list['End'];
$name = $list['Name'];
$location = $list['Location'];
$venue = $list['Venue'];
$money = $list['Money'];
$games = $list['Games'];
$date_array = explode("-",$start);
$date_array2 = explode("-",$end);
$year = $date_array[0];
$month = $date_array[1];
$day = $date_array[2];
$end = $date_array2[2];
$month2 = $date_array2[1];
if ($month != $month2) {
echo "Event Name: ".$name."<br>";
Month($month);echo " ".$day."-"; Month($month2); echo " ".$end.", ".$year;
echo "Location: ".$location."<br>";
echo "Venue: ".$venue."<br>";
echo "Total Prize Money: ".$money."<br>";
echo "Games: ".$games."<br>";
} else {
echo "Event Name: ".$name."<br>";
Month($month);echo " ".$day."-".$end.", ".$year;
echo "Location: ".$location."<br>";
echo "Venue: ".$venue."<br>";
echo "Total Prize Money: ".$money."<br>";
echo "Games: ".$games."<br>";
}
}
?>