当前位置:数据库 > MySQL >>

mysql模糊查询

mysql模糊查询

双引号中出现的变量将自动被解析。
$sql = "SELECT * FROM oneself WHERE name like '%{$colname_Recordset1}' LIMIT {$startRow_Recordset1}, {$maxRows_Recordset1}";
$Recordset1 = mysql_qu

双引号中出现的变量将自动被解析。
$sql = "SELECT * FROM oneself WHERE name like '%{$colname_Recordset1}' LIMIT {$startRow_Recordset1}, {$maxRows_Recordset1}";
$Recordset1 = mysql_query($sql) or die(mysql_error());

{} 放在变量两边是直接指明这是个变量及该变量的名字,

查询汉字,
select * from mytable where mysqlname like "%不%"

如果是大小字区分查询英文字符,
select * from mytable where mysqlname like Binary("%A%")

如果上述条件均要
select * from mytable where mysqlname like "%不%" AND mysqlname like Binary("%A%")

 

select id,name from depart where name like %?%这只是对name进行了模糊查询

我想在对id进行模糊查询,应该怎么样做?
 
 

select id,name from depart where ID like '%123%'

补充:数据库,mysql教程
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,