PHP connection MySQL database to query the time of day (or some time) in the range of data, such as to query the day 17:25-17:35 between the data received in the database, what should be written?
Reply to discussion (solution)
Select ... where time between start and end
SELECT * FROM table where addtime>= '??? ' and addtime<= '?
I only look at the data of the day, the writing upstairs to the database this time all the data are found.
Select ... where time between start and end
How do you write the data on the "Time" day?
How do you write "Start and end" time in seconds?
I'm going to look at the data at this point in time every day, not on a particular day.
SELECT * FROM table where addtime>= '??? ' and addtime<= '?
I only check the data of the day, how to write the data of the day?
How do you write "Start and end" time in seconds?
I'm going to look at the data at this point in time every day, not on a particular day.
Date_format () into the time format you want, then go to query. But the efficiency will be low.
SELECT * FROM table where addtime>= '??? ' and addtime<= '?
I only check the data of the day, how to write the data of the day?
How do you write "Start and end" time in seconds?
I'm going to look at the data at this point in time every day, not on a particular day.
$starttime = ' 17:25:00 ';
$endtime = ' 17:35:00 ';
$sql = "SELECT * from table where addtime>= '". Date (' y-m-d '). ' '. $starttime. ' and addtime<= '. Date (' y-m-d '). ' '. $endtime. ' ";
The original landlord's date and time is divided into two fields, then you have to use the date + time to form a new value, date + Time >= '?? ' and date + time <= '? '
SELECT * FROM table where addtime>= '??? ' and addtime<= '?
I only check the data of the day, how to write the data of the day?
How do you write "Start and end" time in seconds?
I'm going to look at the data at this point in time every day, not on a particular day.
$starttime = ' 17:25:00 ';
$endtime = ' 17:35:00 ';
$sql = "SELECT * from table where addtime>= '". Date (' y-m-d '). ' '. $starttime. ' and addtime<= '. Date (' y-m-d '). ' '. $endtime. ' ";
Thank you very much moderator, already OK, ask this aspect of knowledge should from which books, or Baidu What can find, I just started to learn, I find the book and video only speak basic query, insert, delete operation, further details are not.
#3 I only look at the data of the day, the writing upstairs to the database this time all the data are found.
#4 I'm going to look at the data in this point-in-time range every day, not the data for a particular day.
So what are you going to look for?
SELECT * FROM table where addtime>= '??? ' and addtime<= '?
I only check the data of the day, how to write the data of the day?
How do you write "Start and end" time in seconds?
I'm going to look at the data at this point in time every day, not on a particular day.
$starttime = ' 17:25:00 ';
$endtime = ' 17:35:00 ';
$sql = "SELECT * from table where addtime>= '". Date (' y-m-d '). ' '. $starttime. ' and addtime<= '. Date (' y-m-d '). ' '. $endtime. ' ";
Thank you very much moderator, already OK, ask this aspect of knowledge should from which books, or Baidu What can find, I just started to learn, I find the book and video only speak basic query, insert, delete operation, further details are not.
Look at some sources of source system?