SQL Query to look at "name like %?%" instead of "name like ?"

If you’re Preparing statements, it’s the ONLY solution. The %'s need to be inside the quote marks. Effectively, if you try to put them in as name LIKE %?%, what goes out to the server is name LIKE %“aname”%, which isnt going to work.

2 Likes