Ben aşağıdaki sql (gerçek sorunun bir basitleştirme) var:
SELECT *
FROM t
WHERE myname LIKE '%{$input}%';
How do I escape the $input?
I can't use the quoteInto (unless I miss something).
As
$sql=$DB->quoteInto("SELECT *
FROM t
WHERE myname LIKE '%?%'",$input);
Bana verecek
SELECT *
FROM t
WHERE myname LIKE '%'my input'%';
ve
$sql=$DB->quoteInto("SELECT *
FROM t
WHERE myname LIKE ?",'%'.$input.'%');
Bana vereceksomething on the lines:
SELECT *
FROM t
WHERE myname LIKE '\%my input\%';