Jump to content

Query The DB By Date


refiking

Recommended Posts

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'");

Link to comment
https://forums.phpfreaks.com/topic/181821-query-the-db-by-date/
Share on other sites

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";

Link to comment
https://forums.phpfreaks.com/topic/181821-query-the-db-by-date/#findComment-958933
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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