$sql="select title from title where title like '".%$q%."'";运行后提示
Parse error: syntax error, unexpected '%' in D:\xxxx求正确的 特殊匹配符号  % 用法

解决方案 »

  1.   

    你是不是想这样写 $sql="select title from title where title like '%".$q."%'";
      

  2.   


    %号都写到外面去了,你牛X
    $sql="select title from title where title like '%{$q}%'";
      

  3.   

    while($row = mysql_fetch_array($result))
     { echo "$row['title']" ; }为啥又提示
     syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in 
    注:我是楼主 谁答对这个给分
      

  4.   

    应该自己学习去解决问题,自己google一下,也许会有新发现~
      

  5.   

     echo $row['title'];

     echo "{$row['title']}" ;
      

  6.   

    $sql="select title from title where title like '%".$q."%'";
      

  7.   

    楼主问的问题和标题不符合啊,呵呵,你这个语法错误,sql语句应如10楼那样,至于你的标题‘PHP 访问MYSQL 特殊字符怎么处理’-------特殊字符处理(转义特殊字符:addslashes(),过滤html标签:strip_tags(),转换html:htmlspecialchars())
      

  8.   

    我昨天就为这个问起困扰了一天  不过最后还是解决了     在这给你建议两种方式 试试看
    $sql="select title from title where title like '%.$q.%'";$sql="select title from title where title like '%~$q~%'";