Combine PHP prepared statments with LIKE

后端 未结 6 1788
南方客
南方客 2020-12-02 00:12

Anyone know how to combine PHP prepared statements with LIKE? i.e.

\"SELECT * FROM table WHERE name LIKE %?%\";

6条回答
  •  鱼传尺愫
    2020-12-02 00:54

    You could try something like this:

    "SELECT * FROM table WHERE name LIKE CONCAT(CONCAT('%',?),'%')"
    

提交回复
热议问题