Please guide, simple database statements

Source: Internet
Author: User
Please point, simple database statement
$query = "SELECT OrderID from Orders where
CustomerID = $customerid and
Amount > ". $_session[' Total_price ']." -.001 and//What do you mean by this sentence? " What do you mean,-.001?
Amount < ". $_session[' Total_price ']." +.001 and//What do you mean by this sentence? " What do you mean, +.002?
Date = ' $date ' and
Order_status = ' PARTIAL ' and
Ship_name = ' $ship _name ' and
ship_address = ' $ship _address ' and
ship_city = ' $ship _city ' and
Ship_state = ' $ship _state ' and
Ship_zip = ' $ship _zip ' and
Ship_country = ' $ship _country ' ";
------Solution--------------------
-0.001
+0.001
------Solution--------------------
Total_price value up and down floating 0.001 rice bowls inside

For example
Total_price = 1.001
Value 1.000 to 1.002
------Solution--------------------
is 0.001 and +0.001 of the arithmetic operations.

For example, the value of $_session[' Total_price '] is 1

Then the statement is equivalent to

$query = "SELECT OrderID from Orders where
CustomerID = $customerid and
Amount >0.999 and
Amount < 1.001
and

Date = ' $date ' and
Order_status = ' PARTIAL ' and
Ship_name = ' $ship _name ' and
ship_address = ' $ship _address ' and
ship_city = ' $ship _city ' and
Ship_state = ' $ship _state ' and
Ship_zip = ' $ship _zip ' and
Ship_country = ' $ship _country ' ";
  • 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.