Hi, I am trying to get my date field in a table to display as a long date (%W, %D %M %Y) format, but when I change the query variable using the FORMAT_DATE function it doesn't work at all, I just get a warning error.
die('Could not connect: ' . mysql_error());
}
mysql_select_db("chris", $con);
//$count = "SELECT eventname COUNT(id) FROM events ");
//$id=--echo"$count";
//$eventname="SELECT name FROM events WHERE id=$id";
$query="SELECT id, date, title, cost FROM dates WHERE date > NOW()ORDER BY id asc";
$result=mysql_query($query);
echo "<table border='0' rules='rows' width='95%' padding='10' spacing='0' align='left'>";
while($row = mysql_fetch_array($result))
{
$id=$row['id'];
echo "<tr>";
echo "<td width=\"150\">" . $row['date'] . "</td>";
echo "<td width=\"450\"><a href=viewdate.php?id=" . $id . ">" . $row['title'] . "</a></td>";
echo "<td> £ " . $row['cost'] . "</td></p>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
But when I change my query variable to the following I get Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Chrissy\dates.php on line 52
$query="SELECT id, date, title, cost DATE_FORMAT(date, '%W, %D %M %Y') FROM dates WHERE date > NOW()ORDER BY id asc";
I apologise if this is something for the databases forum, but I wasn't sure :(
I would appreciate all help as this is driving me crazy!!