回答編集履歴
1
リファレンスへのリンクを追加
answer
CHANGED
@@ -2,4 +2,7 @@
|
|
2
2
|
LIKE句とセットで使うので、それぞれに記述が必要です。
|
3
3
|
|
4
4
|
[誤]`$sql = 'select * from table where enable=1 and (a like :a or b like :b) ESCAPE "#"'`
|
5
|
-
[正]`$sql = 'select * from table where enable=1 and (a like :a ESCAPE "#" or b like :b ESCAPE "#")'`
|
5
|
+
[正]`$sql = 'select * from table where enable=1 and (a like :a ESCAPE "#" or b like :b ESCAPE "#")'`
|
6
|
+
|
7
|
+
MySQL5.6リファレンス (利用しているDB・バージョンがわからなかったので一例として)
|
8
|
+
https://dev.mysql.com/doc/refman/5.6/ja/string-comparison-functions.html
|