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%'