Note: Mysql,sql Server,dbms and so on like wildcard characters do not support Text,ntext support only
Char,varchar,nvarchar, wait.
$s = "SELECT * from Test where dmulplace like '% $city% '"
ID UID parttime City
211 7117 Full-time Changsha, Yiyang
5510 12419 Full-time
5511 12420 Full-time Dongguan,
209 7115 Full-time Changsha
Results recorded in two
211 7117 Full-time Changsha
209 7115 Full-time Changsha
Here's a look at the simple SQL like wildcard description
_ and any single character match
% matches a string that contains one or more characters
[] matches any single character in a particular range (for example, [a-f]) or in a specific set (for example, [abcdef]).
[^] matches any single character that is outside a specific range (for example, [^a-f]) or a specific set (for example, [^abcdef])
。
Use the like comparison word, plus the wildcard characters in SQL, refer to the following:
A.. like ' mc% ' will search for all strings (such as McBadden) that begin with the letter Mc.
B.. like '%inger ' will search for all strings ending with the letter inger (such as Ringer,
Stringer).
C. Like '%en% ' will search all strings containing the letter en in any location (such as Bennet,
Green, McBadden).
D. Like ' _heryl ' will search for all six-letter names ending with the letter heryl (such as Cheryl,
Sheryl).
E. Like ' [Ck]ars[eo]n ' will search for the following strings: Carsen, Karsen, Carson, and Karson
(such as Carson).
F. Like ' [M-z]inger ' will search for any single word that ends with a string inger, from M to Z
All names (such as Ringer) that begin with the parent.
G.. like ' m[^c]% ' will search begins with the letter M, and the second letter is not all the names of C (for example,
Macfeather).