How do I create a PDO parameterized query with a LIKE statement?

后端 未结 7 1186
眼角桃花
眼角桃花 2020-11-22 04:47

Here\'s my attempt at it:

$query = $database->prepare(\'SELECT * FROM table WHERE column LIKE \"?%\"\');

$query->execute(array(\'value\'));

while ($r         


        
相关标签:
7条回答
  • 2020-11-22 05:20

    This works:

    search `table` where `column` like concat('%', :column, '%')
    
    0 讨论(0)
提交回复
热议问题