本帖最后由 u8873zhao 于 2010-11-19 19:55:00 编辑

解决方案 »

  1.   

    呵呵,你倒数第二句有点问题,php中字符链接要用到.的,你完全可以这样
    $key='%'.$key.'%';
    select * from aaa where title like '$key';
    不就可以了嘛!
      

  2.   


    'select * from aaa where title like \'%' . mysql_real_escape_string($key) . '%\''
      

  3.   


    只要like $key;  应该就好了吧
      

  4.   

    $key=mysql_real_escape_string($key)
    sql="select * from aaa where title like '%$key%' "这样就行了?会不会存在注入问题?