refiking Posted November 17, 2009 Share Posted November 17, 2009 I need to search for all the records that meet the included conditions and the timestamp is on today's date. Here is the sql query that I have so far: $sql3 = mysql_query("select plan_sets_id from plan_sets where plan_sets_types_id = '3' and jobs_id = '16' and plan_sets_id != '125'"); Quote Link to comment https://forums.phpfreaks.com/topic/181821-query-the-db-by-date/ Share on other sites More sharing options...
ngreenwood6 Posted November 17, 2009 Share Posted November 17, 2009 Well thats not very much info on what you are actually trying to do. Are your storing it as a timestamp(php's time(), date, datetime? What conditions are you trying to meet? But just as a basic example you can simply do: $query = "SELECT * FROM table WHERE time > $less_time and time < $more_time"; Quote Link to comment https://forums.phpfreaks.com/topic/181821-query-the-db-by-date/#findComment-958933 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.