0

I'm trying to get a query with a LIKE comparison going in Fat Free Framework.

$db->exec('SELECT * FROM ideas WHERE name LIKE %:idea%',array(':idea'=>$idea));

That's the query.

The error I'm getting is

PDOStatement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%'unit'%' at line 1`

Seems like the prepared statement inserts quotes between the placeholders (%), which leads to an error. Can I somehow write this in another way or prevent the quotes from appearing?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
nameless
  • 1,483
  • 5
  • 32
  • 78

0 Answers0