How does php query data within a certain time range of the current day? To connect to the mysql database using php, you need to query data within a certain period of time (or several moments) every day. for example, you need to query whether data is received in the database between-on the current day, what should I do?
Reply to discussion (solution)
Select... where time between start and end
Select * from table where addtime> = '? Start ?? And addtime <= '? ?? ';
I only checked the data of the day. The upstairs writing method found all the data in the database during this time period.
Select... where time between start and end
How to write data on the day of "time?
The start time and end time are only hours, minutes, and seconds. how can this problem be solved?
I want to query the data within the time range of each day, instead of the data of a specific day.
Select * from table where addtime> = '? Start ?? And addtime <= '? ?? ';
I only query the data of the current day. how do I write the data of the current day?
The start time and end time are only hours, minutes, and seconds. how can this problem be solved?
I want to query the data within the time range of each day, instead of the data of a specific day.
DATE_FORMAT () is the time format you want to query. However, the efficiency will be low.
Select * from table where addtime> = '? Start ?? And addtime <= '? ?? ';
I only query the data of the current day. how do I write the data of the current day?
The start time and end time are only hours, minutes, and seconds. how can this problem be solved?
I want to query the data within the time range of each day, instead of the data of a specific 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 are stored in two fields, then you have to use date + time to form a new value, with date + time> = '? Start date ?? 'And date + time <= '? Start date ?? '
Select * from table where addtime> = '? Start ?? And addtime <= '? ?? ';
I only query the data of the current day. how do I write the data of the current day?
The start time and end time are only hours, minutes, and seconds. how can this problem be solved?
I want to query the data within the time range of each day, instead of the data of a specific 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. "'";
I am very grateful to the moderator. I am already OK. which books or Baidu can I find for this knowledge? I just started to learn about it. I only talk about basic queries for the books and videos I am looking, insert and delete operations. no further details are available.
#3 I only query the data of the day. The upstairs writing method found all the data in the database during this time period.
#4 I want to query the data within the time range of each day, instead of the data of a specific day.
So what are you looking?
Select * from table where addtime> = '? Start ?? And addtime <= '? ?? ';
I only query the data of the current day. how do I write the data of the current day?
The start time and end time are only hours, minutes, and seconds. how can this problem be solved?
I want to query the data within the time range of each day, instead of the data of a specific 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. "'";
I am very grateful to the moderator. I am already OK. which books or Baidu can I find for this knowledge? I just started to learn about it. I only talk about basic queries for the books and videos I am looking, insert and delete operations. no further details are available.
Look at some? SOURCE system? ?.