Jump to content


Photo

Organize Content by Date PHP And MySQL


  • Please log in to reply
1 reply to this topic

#1 tgmd

tgmd
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 13 July 2006 - 04:10 AM

I have a Mysql data base. I have several entry's that are all organized by time (standard way mysql inserts it, it looks something like 20060711123751 (year, month, day, hours, minutes, seconds) all in one string. Now I need to print all of these out (let's say there's three of them) by date (earliest one first). I need to know if there's a PHP or Mysql funtion for this.

Any help would be greatly appreciated

thanks in advance.

#2 meman1188

meman1188
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 13 July 2006 - 05:23 AM

i don't know of a way to do it in PHP, but you can ORDER your mysql query and have it return the dates in any order you like.  Hope this helps.

ex query: SELECT *  FROM `table` ORDER BY `DATE (field)` ASC

-- Brady




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users