pietbez Posted October 1, 2008 Share Posted October 1, 2008 can anyone help please? i want to output my date in this format "wed 1 Oct 2008" at the moment this is what i have "2008-10-01" i dont know how to work the changes into my script.. <? include('../qazwsxedc/config.php'); mysql_connect($server,$username,$password); @mysql_select_db($database) or die ("Unable to connect to the database"); $id=$_POST['id']; $yesterday = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $do=mysql_query ("SELECT c.id, c.venue_name, c.event_date, v.town FROM calendar_events c INNER JOIN venues v ON c.venue_name = v.venue WHERE c.status='confirmed'and c.event_type='gig'and c.event_date >'$yesterday' ORDER by c.event_date ASC "); $x=mysql_num_rows($do); if ($x>0) { while ($row = mysql_fetch_array($do, MYSQL_ASSOC)) { $name.=$row["venue_name"].','.$row["event_date"].','.$row["town"]; $name.='|'; $ids.=$row["id"].'|'; } ;} echo "&total=".$x."&header=".$name."&ids=".$ids; ?> Link to comment https://forums.phpfreaks.com/topic/126589-date-format/ Share on other sites More sharing options...
Wuhtzu Posted October 1, 2008 Share Posted October 1, 2008 What format / type of date does $row["event_date"] hold? That's what you need to change, right? Link to comment https://forums.phpfreaks.com/topic/126589-date-format/#findComment-654590 Share on other sites More sharing options...
adroit Posted October 1, 2008 Share Posted October 1, 2008 Use DATE_FORMAT() in the SQL query. Link to comment https://forums.phpfreaks.com/topic/126589-date-format/#findComment-654592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.