Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Apostrophe in db searches

$
0
0
I am using a passed variable to search my db for a specific title. The title stored in the db has an apostrophe in the title (i.e. "Am I My Brother's Keeper") A var_dump shows the result 'string(26) "Am I My Brother\'s Keeper?"'

Obviously this causes the query to return no results as it seems to read the apostrophe in the variable as a escape (\?)

Is there a way to format the variable to recognize the apostrophe or is it just easier to rename all the title fields in the database (and the mp3 the stored path points to) to remove apostrophe's?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>