Thank you for your help. I tried both suggestions and neither worked.
My original code looked like this:
include ("includes/db_connect.php");
$result = mysql_query("SELECT * FROM jokes ORDER BY jokes_id DESC LIMIT 3");
mysql_close($db_connect);
while($row = mysql_fetch_array($result)){
$title = htmlentities ($row['title']);
$author = htmlentities ($row['author']);
$joke_body = nl2br ($row['joke_body']);
$date = htmlentities ($row['date']);
echo "$date";
}
and it displayed "yyyy-mm-dd"
Now my code is:
include ("includes/db_connect.php");
$result = mysql_query("SELECT title, author, joke_body, DATE_FORMAT(post_date, '%d-%m-%Y') FROM jokes ORDER BY jokes_id DESC LIMIT 3");
mysql_close($db_connect);
while($row = mysql_fetch_array($result)){
$title = htmlentities ($row['title']);
$author = htmlentities ($row['author']);
$joke_body = nl2br ($row['joke_body']);
$date = htmlentities ($row['post_date']);
echo "$date";
}
and displays nothing. Could there be something I'm missing when I create the $date variable, do I need to add anything to it since I'm now using the DATE_FORMAT()?
Thanks