Jump to content

[SOLVED] Not properly ordering by date


Eiolon

Recommended Posts

For some reason it is ordering alphabetically based on the name of the month not the actual date.  I am using a MySQL datetime field.

 

Query:

 

// Query the database for participant information.
$query_participants = "SELECT participant_id, participant_name, participant_phone, DATE_FORMAT(participant_added, '%M %e, %Y %l:%i %p') as convdate2, participant_age, participant_paid, participant_program FROM participants WHERE participant_program = ".$_GET['program_id']." ORDER BY convdate2 ASC";
$participants = mysql_query($query_participants) OR die ('Cannot retrieve participants.');
$row_participants = mysql_fetch_array($participants);

 

Result:

 

December 1, 2007 1:58 PM
November 27, 2007 5:26 PM
November 27, 2007 5:26 PM
November 30, 2007 3:20 PM

Link to comment
https://forums.phpfreaks.com/topic/80537-solved-not-properly-ordering-by-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.