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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.