I am trying to display items from my database that occur after the current date but within the next 28 days. I have wrote my script and the part that retrieves the information from the database works in phpmyadmin however when I load the page in the browser nothing below my php script is showing up on the page, where have I gone wrong?
<?php
//connect to the database
include 'php/database_connection.php';
//retrieve all the information for the events within 28 days of the current date from the database
$dateSQL = "SELECT eventID, eventTitle, eventDescription, eventStartDate, eventEndDate
FROM te_events
WHERE eventStartDate > CURRENT_DATE AND eventStartDate < CURRENT_DATE + INTERVAL 28 DAY
ORDER BY eventStartDate";
//execute the query and store the results
$queryDate = mysqli_query($dateSQL)
or die(mysqli_error());
//loop through database and store in variables
while ($row = mysqli_fetch_array($queryDate)) {
$eID = $row['eventID'];
$start = $row['eventStartDate'];
$end = $row['eventEndDate'];
$title = $row['eventTitle'];
$desc = $row['eventDescription'];
//echo events within the 4 week timeframe
echo "<div class=\"date\">$start - $end</div> ";
echo "<div class=\"title\"><a href=\"full_details.php?eventID=$eID\"></a></div> ";
echo "<div class=\"desc\">$desc</div>\n ";
}
?>