PDO and LIKE

Hey,

I have a query running under the PDO extension but when I use LIKE clause it always fails and no errors are thrown

IE:

AND uploaded_songs.uploaded_songName LIKE “:searchTerm%”

And when I bind it:

$objStatement->bindParam(‘:searchTerm’, $strSearchTerm, PDO::PARAM_STR);

It fails. Anyone have any help? thanks.

Apply the “%” operator to $strSearchTerm. And do:

AND uploaded_songs.uploaded_songName LIKE :searchTerm

btw- you might want to escape the % and _ characters yourself. see addcslashes()