1

I'm having trouble finding likes with special characters as follows in the database i have a record with the name Toan"123 now, in cakephp 3 i use query ORM

$sqlSub = $sysLogTable
    ->find('all', [
        'fields' => array('id' ,'name')
        'conditions' => array("name LIKE" => "%Toan"%")
    ])
    ->toArray();

but I don't get Toan"123. How to get Toan"123 with sql above. Please help me, I'm stuck

ndm
  • 59,784
  • 9
  • 71
  • 110
  • That's invalid PHP, you cannot put an unescaped double quote in a double quoted string, which you can see from the syntax highlighting, and from the inevitable parser error that you'd receive when running that code. **https://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php** – ndm Jan 21 '22 at 12:52
  • thnaks pro, is there any way that can help me to search with the character " ? – Toàn Kiều Jan 24 '22 at 01:35

0 Answers0