I am converting some MySQL queries in PHP into PDO prepared statement queries.
Most queries are simple enough, but I have come across a couple of queries and I Am not sure how they should look
in the regular queries I am converting:
where field ='$type'
where field =:type
where field like '$type%'
The thing you need to understand is that a placeholder have to represent a complete data literal only.
And thus your code will be:
Create a search string with wildcard characters in PHP,
$type = "$type%";
and then you can bind it the usual way.
Just add one more argument for CONCAT():