Home >Daily Programming >Mysql Knowledge >What is the usage of is, between, in and other operators in PHP?
We have learned so much about PHP, but I wonder what your usage of is, between, in and other operators in PHP is? Have you fully mastered it? If not, then follow this article to continue learning
Related recommendations:How to use additions, deletions, and modifications in PHP?
is operator: Judgment of null value and Boolean value
There are 4 situations to use:
xx is null: judge that a certain field is a "null" value - that is, there is no value, xxis not null: judge that a certain field is not a "null" value
xx is true: Judge a certain field as "true"
between operator: range judgment
is used to judge whether the data value of a certain field is within a given range - suitable for numeric types,Syntax:
xxbetween值1and值2,含义: XX字段的值在给定“值1”和“值2”之间,其实相当于:XX=值1 and xx <=值2;
in operator: given the range judgment of certain data
Syntax:xxin(值1,值2,值3,...-.);含义﹔means that the value of field XX is One of the listed values is considered to have met the conditions; these values are usually scattered and irregular. If the data it lists has certain rules, it can actually be used Logical operator or between operator instead.
like operator: fuzzy search on string
Syntax:xX like‘要查找的内容"
Common examples and meanings:
name like "%罗%": Represents all data rows with the word "罗" in nam, name like "Luo%xin: Represents all data rows starting with "Luo" in nam, such as: Roland, name like "%Luo"; Represents all data rows ending with "Luo" in nam; for example: c Luo, Contranamelike·Luo_": Represents all data lines in nam that begin with "Luo" and have only 2 characters, such as: Luo Lanname like·_Luo ": Represents all data lines in nam that end with "Luo" and have only 2 characters, such as: c LuoA new question:If I want to find a certain What should I do if the lines containing "%""
mysql tutorial(video)
The above is the detailed content of What is the usage of is, between, in and other operators in PHP?. For more information, please follow other related articles on the PHP Chinese website!