Anyone know how to combine PHP prepared statements with LIKE? i.e.
\"SELECT * FROM table WHERE name LIKE %?%\";
I will just adapt Chad Birch's answer for people like me who are used to utilize bindValue(...) for PDO:
bindValue(...)
$st = $db->prepare("SELECT * FROM table WHERE name LIKE :name"); $st->bindValue(':name','%'.$name.'%',PDO::PARAM_STR); $st->execute();