Php searches for order data based on the input start time and end time & lt; form & nbsp; nameform2 & nbsp; methodget & nbsp; actionshops_operations.php & gt; & nbsp; & lt; input & nbsp; namestarttime & nbsp; typetext & nbsp; idstarttime php searches for order data based on the input start time and end time
The database table name is dede_shops_orders, and the time field is stime (int type). It has been converted to time data. it is displayed:; the control is ready and you want to search based on the time data of the two inputs, how to deal with PHP pages!
------ Solution ----------------------
Where interval query in select,> and <
------ Solution ----------------------
The shops_operations.php page writes an SQL statement based on the input start time $ startTime and end time $ endTime.
Select * from dede_shops_orders where 'stime' between $ startTime and $ endTime.
First, convert the start time and end time to an integer.
------ Solution ----------------------
Reference:
Quote: reference:
Quote: reference:
The shops_operations.php page writes an SQL statement based on the input start time $ startTime and end time $ endTime.
Select * from dede_shops_orders where 'stime' between $ startTime and $ endTime.
First, convert the start time and end time to an integer.
// Query order time
$ T1 = $ _ POST ['starttime']; // start time
$ T2 = $ _ POST ['endtime']; // end time
// Var_dump ($ t1 );
// Die;
$ SQL = "select * from dede_shops_orders where 'stime' between $ startTime and $ endTime .";
$ Result = mysql_query ($ SQL );
While ($ row = mysql_fetch_row ($ result )){
Echo $ row [0]. ''. $ row [1].'
';
}
Now, this stime database is 140551515 processed using functions... What should I do next?
$ SQL = "select * from dede_shops_orders where 'stime' between $ t1and $ t2.
This is the result of searching by start time and end time.
------ Solution ----------------------
You printed $ t1 $ t2 and the stime field stored in the database. what is it like?
------ Solution ----------------------
... You can see the problem. your form is submitted in get mode. $ _ POST is used when you get the value. The value cannot be obtained.
------ Solution ----------------------
Method = "get" to method = "post"
------ Solution ----------------------
The proportion must be in the same format. Since the time saved in your database is int, the time condition is also converted to int for comparison.