dongzhan1948 2014-10-07 07:36
浏览 31

MySql like运算符用于选择在移动设备中无法正常工作的所有记录

    $table->select()->where("(`{$searchTableName}`.`title` LIKE ? || `{$searchTableName}`.`description` LIKE ? || `{$searchTableName}`.`keywords` LIKE ?)", "%{$text}%");

Here is my code.'$text' is the variable specifying the keyword that we are going to search.When I run the above code and inspected it ,the preview will look like below.

  SELECT `engine4_core_search`.* FROM `engine4_core_search` WHERE ((`engine4_core_search`.`title` LIKE '«b%' || `engine4_core_search`.`description` LIKE '«b%' || `engine4_core_search`.`keywords` LIKE '«b%'))

Here I used the keyword 'abb'.But in query it appeared as '«b'.What may be the reason for stripping the first two characters and the '%' operator? This happens only when I try to select all the records containing the specific keyword. Also it works correctly in web. The issue comes only in the case of Mobile devices like Iphone and Ipad..Please help me.

  • 写回答

1条回答 默认 最新

  • douxu3315 2014-10-10 09:08
    关注

    If you a re using jQuery-mobile (because issue is in mobile device). In some cases jQuery-mobile may produce this kind of issues. Try without jQuery-mobile .

    评论

报告相同问题?