PHP searches for order data based on input start time end time

Source: Internet
Author: User
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.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.