Wonder if someone can give me a hand. My select statement is working on command line, but not in PHP.
SELECT id,DAY(date),MONTH(date),title,location,address,timestart,timeend,ticketprice,buynowaddress FROM Events WHERE active = true ORDER BY date DESC
But when I put it into PHP, I get an error:
Notice: Undefined index: date in /var/www/html/site.com/evets.php on line 9
Here is the PHP:
<?php
include("dbconnect.php");
$result = mysql_query("SELECT id,DAY(date),MONTH(date),title,location,address,timestart,timeend,ticketprice,buynowaddress FROM Events WHERE active = true OR$
while ($row = mysql_fetch_array($result)) {
echo "<p>ID: " .$row['id'] ."<br>";
echo "Title: " .$row['title'] ."<br>";
echo "Date: " .$row['date'] ."<br>";
echo "Location: " .$row['location'] ."<br>";
echo "Address: " .$row['address'] ."<br>";
echo "Time Start: " .$row['timestart'] ."<br>";
echo "Time End: " .$row['timeend'] ."<br>";
echo "Ticket Price: " .$row['ticketprice'] ."<br>";
echo 'Buy Ticket Link: <a href="' .$row['buynowaddress'] .'">address</a><br></p>';
echo "<hr>";
}
?>
Thank you all in advance