PHP searches for order data based on the input start time end time
The database table name is Dede_shops_orders, the Time field is stime (int type) has been converted to time data display:; The control is done, want to based on two input time data search, PHP page How to deal with Ah, ask the big God pointing!
------to solve the idea----------------------
When select, where interval query,> and <
------to solve the idea----------------------
The shops_operations.php page writes out the SQL based on the $startTime and end time of the transmitted start time $endTime.
SELECT * from Dede_shops_orders where ' stime ' between $startTime and $endTime.
The start time and end time are also converted to integral types first
------to solve the idea----------------------
References:
Quote: References:
Quote: References:
The shops_operations.php page writes out the SQL based on the $startTime and end time of the transmitted start time $endTime.
SELECT * from Dede_shops_orders where ' stime ' between $startTime and $endTime.
The start time and end time are also converted to integral types first
Order Time Enquiry
$t 1=$_post[' StartTime '];//start time
$t 2=$_post[' endtime '];//end time
Var_dump ($t 1);
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 it's changed. This stime database is 140551515 and has been processed with functions ... What's the next change?
$sql = "SELECT * from Dede_shops_orders where ' stime ' between $t 1and $t 2.
This is already searching for results by start and end time.
------to solve the idea----------------------
You print the next $t 1 $t 2 and what are the stime fields stored in the database?
------to solve the idea----------------------
。。。 Oh, I see the problem. Your form form is submitted by the Get method. When you get the value, you use $_post, you can't get the value.
------to solve the idea----------------------
Method= "get" changed to method= "POST"
------to solve the idea----------------------
Use the same format when using the scale. Since the time in your database is int, the time condition is also converted to int to compare.