Use php+mysql to query the data instances of that day, this week and this month.
This article mainly introduces "using php+mysql to query the data instances of that day, this week and this month". In the daily operation, I believe many people have doubts about using php+mysql to query the data examples of that day, this week and this month. I have consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "using php+mysql to query data instances of that day, this week and this month." Next, please follow the editor to study!
/ / where video is the table name; / / createtime is the field; / the database time field is a timestamp / on the day of the query: $start = date ('Y-m-d 00lv 00lv 00'); $end = date (' Y-m-d Hlav table_ s'); SELECT * FROM `table_ name` WHERE `time` > = unix_timestamp ('$start') AND `time` = unix_timestamp ('. $start.') AND `time` = unix_timestamp ('$start') AND `time`