Ollifi Posted August 27, 2011 Share Posted August 27, 2011 Hello, i have mysql DB and there is one time column in each row. What query I should use to get all rows marked eg. 12th aug? the time is marked in php time() format Quote Link to comment Share on other sites More sharing options...
fenway Posted August 28, 2011 Share Posted August 28, 2011 I don't follow. Quote Link to comment Share on other sites More sharing options...
ionutvmi Posted August 28, 2011 Share Posted August 28, 2011 use strtotime() to get time value of 12th aug 00:00 and get first value then add to that value 24 hours (in seconds) and get the second value select from table where time is bigger then the first value and is smaller then the second value Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 29, 2011 Share Posted August 29, 2011 I think your looking for this: select * from table_name where date_format(from_unixtime(timestamp_col), '%m-%d') = '08-12'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.