This is SQL query stored in PHP's var:
PHP Code:
$sql =
'SELECT t1.for
FROM t1, t2
WHERE t1.for = t2.for && t1.for
REGEXP \'[^0-9]?[^0-9]\'';
Question mark in a middle of regexp statement, is supposed to be a binding placeholder, for prepared statement!
So when I escape it like:
PHP Code:
$sql =
'SELECT t1.for
FROM t1, t2
WHERE t1.for = t2.for && t1.for
REGEXP \'[^0-9]\\\?[^0-9]\'';
It just escaped special meaning in regexp itself and is now litteral symbol which is part of a pattern.
I want it to become(?) a binding placeholder inside of regexp pattern.