Sorry that I keep posting this same script!
Im just trying to make the dates of the shows be formatted as "June 10th" for example.
I have searched threads on here and found this thread...
http://www.codingforums.com/showthread.php?t=57580
I tried using the solution by inserting $date = date('F d, Y', strtotime($date)); and then using $date as the variable to echo. However all my dates then for some obscure reason become May 4th...
Anyone know what I'm doing wrong? My script is functional but this will make it much more prettiful
<?php
require ('../../dryriseconnect.php');
//select future show dates from db
$result = mysql_query('SELECT * FROM shows WHERE showdate > DATE_SUB(CURDATE(), INTERVAL 0 DAY) ORDER BY showdate ASC',$db) or die ('Unable to perform selectquery. Exit script');
//if no rows returned, then say so
if (mysql_num_rows($result) < 1){
echo 'No dates to display.';
} else {
$last_month = "";
while ($row=mysql_fetch_assoc($result))
{
if($last_month != date("F", strtotime($row['showdate'])))
{
echo '<p class="heading">' . date("F", strtotime($row['showdate'])) . '<p>';
}
echo '<p class="main">' . $row['showdate'] . ' - ' . $row['venue'] . ', ' . $row['location'] . "\n" . '</span><br>' . "\n" .
'<span class="main">' . $row['showinfo'] . '</span>' . "\n";
$last_month = date("F", strtotime($row['showdate']));
}
}
?>