Home Daily Programming Mysql Knowledge What is the usage of is, between, in and other operators in PHP?

What is the usage of is, between, in and other operators in PHP?

Jun 28, 2021 pm 04:31 PM
in is

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"

  • ##xxis false: Judge a certain field as "false" (false): o, 0.0, ". null

  • The so-called Boolean value is actually an "alias" of the tinyint(1) type. In essence, it just determines whether a number is 0

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;
Copy after login

in operator: given the range judgment of certain data

Syntax:

xxin(值1,值2,值3,...-.);含义﹔
Copy after login

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‘要查找的内容"
Copy after login

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, Contra

namelike·Luo_": Represents all data lines in nam that begin with "Luo" and have only 2 characters, such as: Luo Lan

name like·_Luo ": Represents all data lines in nam that end with "Luo" and have only 2 characters, such as: c Luo

A new question:

If I want to find a certain What should I do if the lines containing "%"" in the field? Escape is ok:

%: represents the character % itself

L_: represents the character _ itself. Example ;

xX like "%9i% " ;

represents all lines containing the percent sign (%〉) in XX,

Related learning recommendations:

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Tips for using i18n to implement multi-language switching in Vue Tips for using i18n to implement multi-language switching in Vue Jun 25, 2023 am 09:33 AM

With the continuous development of internationalization, more and more websites and applications need to support multi-language switching functions. As a popular front-end framework, Vue provides a plug-in called i18n that can help us achieve multi-language switching. This article will introduce common techniques for using i18n to implement multi-language switching in Vue. Step 1: Install the i18n plug-in First, we need to install the i18n plug-in using npm or yarn. Enter the following command at the command line: npminst

What do out and in interfaces mean? What do out and in interfaces mean? Sep 28, 2021 pm 04:39 PM

The out interface refers to the output interface, and the in interface refers to the input interface. The out interface generally represents the audio source line output interface, which is used to connect loads, such as speakers, headphones, etc.; while the in interface generally represents the audio source line input interface, which is used to connect CD players, mobile phones, MP3 players, computers, etc.

From beginner to proficient: Master the skills of using is and where selectors From beginner to proficient: Master the skills of using is and where selectors Sep 08, 2023 am 09:15 AM

From beginner to proficient: Master the skills of using is and where selectors Introduction: In the process of data processing and analysis, the selector is a very important tool. Through selectors, we can extract the required data from the data set according to specific conditions. This article will introduce the usage skills of is and where selectors to help readers quickly master the powerful functions of these two selectors. 1. Use of the is selector The is selector is a basic selector that allows us to select the data set based on given conditions.

What is the difference between on, in, as, and where in Mysql? What is the difference between on, in, as, and where in Mysql? Jun 03, 2023 am 11:37 AM

The difference between Mysqlon, in, as, and where Answer: Where query conditions, use on for internal and external connections, as as an alias, in to query whether a certain value creates 2 tables in a certain condition: student, scorestudent: score: whereSELECT*FROMstudentWHEREs_sex=' Male'For example: onSELECT*FROMstudentLEFTJOINscoreonstudent.s_id=score.s_id; combination of on and where: SELECT*FROMstudentLEFTJOINs

Five ways to fix Thread Stuck in Device Driver blue screen Five ways to fix Thread Stuck in Device Driver blue screen Mar 25, 2024 pm 09:40 PM

Some users reported that after installing Microsoft's March Win11 update patch KB5035853, a blue screen of death error occurred, with &quot;ThreadStuckinDeviceDriver&quot; displayed on the system page. It is understood that this error may be caused by hardware or driver issues. Here are five fixes that will hopefully resolve your computer blue screen problem quickly. Method 1: Run system file check. Run the [sfc/scannow] command in the command prompt, which can be used to detect and repair system file integrity issues. The purpose of this command is to scan and repair any missing or damaged system files, helping to ensure system stability and normal operation. Method 2: 1. Download and open the &quot;Blue Screen Repair Tool&quot;

How to do multi-language processing in Vue? How to do multi-language processing in Vue? Jun 11, 2023 pm 03:22 PM

In actual development, multi-language support for websites or applications has become a necessary feature. As a popular JavaScript framework, Vue also supports multiple languages. This article will introduce the scheme and implementation details of multi-language processing in Vue. Solution Selection There are many multi-language support solutions, including but not limited to the following: 1.1. Front-end integrated implementation of multi-language functions on the front end, supported through the vue-i18n plug-in. Introducing the corresponding language pack as an independent component can display different

Take stock of some practical Linux tips Take stock of some practical Linux tips Mar 12, 2024 pm 01:49 PM

Linux is a powerful operating system with many useful commands and tips to help you use it more efficiently. 1. Check the file check value. During the file copying or transmission process, the file may be damaged or modified. In this case, the check value can be used for verification. Usually, we need to use some interface programs provided by other teams in our work. Whenever the running results of these programs are not as expected, we will compare the md5 check values ​​of both parties to confirm the consistency of the data. There are many ways to generate the check value of a file. Commonly used ones include md5sum check, crc check, sum check, etc. The commands are: md5sumfile_namecksumfile_namesum algorithm parameter file

How to use i18n in CakePHP? How to use i18n in CakePHP? Jun 04, 2023 pm 12:10 PM

CakePHP is an open source PHP framework that supports the integration of multi-language internationalization (i18n). i18n can make your application multilingual, making it easier for you to attract international audiences and better serve local users. In this article, we will take an in-depth look at the usage of CakePHPi18n. Getting Started First, you need to enable CakePHP’s multilingual capabilities. To do this, update the configuration file config/bootstrap.php and add the following code to your application

See all articles