select * from customer where upper(customername) like '%strtoupper($cname)%';

解决方案 »

  1.   

    use the same way, u can write sql like this:
    select * from customer where ucase(customername) like '%strtoupper($cname)%';
    or:
    select * from customer where lower(customername) like '%strtolower($cname)%';
    select * from customer where lcase(customername) like '%strtolower($cname)%';
      

  2.   

    你的MYSQL在什么环境下的,因为默认情况下MYSQL是不区分大小写,所以说你看看customername这个字段有没有加了binary属性了??若加了就把他去掉。
      

  3.   

    $cname='sun'
     select * from customer where customername like '$cname%'