Comparison and Logical operators are used for testing data values. Sadly the operators to use are not consistent across languages. This article summarises the most common operators for the key web development languages:
For SQL we checked both mySQL and MS SQL. All operators listed here should work in both.
|Less than or equal to||<=||<=||<=||<=|
|Greater than or equal to||>=||>=||>=||>=|
|Equal to||==||=||== (equal)
|Not equal to||!=||<>||!= (not equal)
<> (not equal)
!== (not identical)
Testing for “identical” in PHP arrived with PHP 4. Two values are identical if they are the same, and the same type. Eg the values “1″ (a string) and 1 (an integer) are equal but not identical.
PHP provides two options for AND and OR with different operator precedences. Refer to the PHP manual: Operator Precedence for details.