Jump to content

Order by TimeStamp DESC PHP query


Mudsaf

Recommended Posts

Hello, im not sure should i add this to "SQL" category since this is bit more sql-related but any fix to this. I have timestamp field in my database and it has worder ORDER BY Desc so far from oldest to newest and now at 2013 it doesn't work like that.

SELECT * FROM ms_news ORDER BY newsDate DESC LIMIT 0, 1

Last 2 values Code displays this

2013-01-03 01:48:05   

Should display this

2013-01-04 01:03:53 

At year 2012 it worked from oldest to newest so im not sure does the 2013 year mess the desc somehow. Blargh fixed, had taken the value from Date and not Datetime :P

Edited by Mudsaf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...