e1seix Posted July 8, 2008 Share Posted July 8, 2008 Have a slight query... If I am running a script that updates my database with pre populated info like a product description, I keep coming across an error. One of the places I'm lifting info from is a paragraph of words defined as a variable eg. $desc $desc = "Jack and Jill's heads were hurting from the fall"; Automatically my script, because it's in a loop, ceases the minute it comes across the apostrophe symbol. What I need is a script that will detect the apostrophe symbol and know to change it to ' before including it in the database. ie. $desc = "Jack and Jill's heads were hurting from the fall"; How would one go about doing this? It's not just some sort of simple regex because I have no control over the various paragraphs - they will differ - and some will even have more than one apostrophe... You all know me - I'm useless at this kind of thing. lol Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 8, 2008 Share Posted July 8, 2008 mysql_real_escape_string() should take care of all that... Quote Link to comment Share on other sites More sharing options...
e1seix Posted July 8, 2008 Author Share Posted July 8, 2008 I love you DarkWater. You always feed me a clue to get the answer and never let me away with just getting someone to do the hard work for me. I suppose it's the only way I'll learn. lol. Thank you Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 8, 2008 Share Posted July 8, 2008 Heh, no problem. It's always better to try to just HELP people figure it out, and not do it for them. Because well...then they don't learn anything. Please mark this topic as solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.