The following code is often used in php to obtain the SQL query statement for determining the date.
Copy codeThe Code is as follows:
$ Now = time (); // get the current date
$ SQL = "select * from 'team' where end_time> $ now ORDER BY sort_order limit 0, 4 ";
Obtain the MySql time function of the current time
There are many functions for processing MySql time and date. The following describes the MySql time functions used to obtain the current time. If you are interested in this, take a look.
The MySql time functions described below are used to obtain the current time. These MySql time functions are of great practical value and hope to help you learn MySql time functions.
Copy codeThe Code is as follows:
Mysql> select current_timestamp ();
+ --------------------- +
| Current_timestamp () |
+ --------------------- +
| 21:24:37 |
+ --------------------- +
1 row in set (0.00 sec)
Mysql> select current_date ();
+ ---------------- +
| Current_date () |
+ ---------------- +
| 2010-01-18 |
+ ---------------- +
1 row in set (0.00 sec)
Mysql> select current_time ();
+ ---------------- +
| Current_time () |
+ ---------------- +
| 21:24:46 |
+ ---------------- +
1 row in set (0.00 sec)