niche Posted August 25, 2011 Share Posted August 25, 2011 When I escape an apostrophe in a <textarea>, in a <form>, "Joe\'s coat." get's saved as "Joe's coat." in the table, but it displays correctly on my browser as "Joe's coat.". It seems the escaping is only important for the mysql UPDATE query. If so, how do I avoid, having to manually re-enter the escaping, each time I need to UPDATE a column with text that has apostrophes in a <form>? Link to comment Share on other sites More sharing options...
boen_robot Posted August 25, 2011 Share Posted August 25, 2011 mysql_real_escape_string()? I mean, that is after all its purpose - to take any code, and add slashes to any characters that are needed for the string to be treated as a single string (as opposed to part of a query). Link to comment Share on other sites More sharing options...
justsomeguy Posted August 25, 2011 Share Posted August 25, 2011 You're seriously manually escaping everything when you type it? The computer is supposed to do the work here.http://www.php.net/manual/en/function.mysq...cape-string.php Link to comment Share on other sites More sharing options...
niche Posted August 25, 2011 Author Share Posted August 25, 2011 I'm not doing that manually anymore! I may frequently get the lessons out of order, but I do get them. Thanks for your help boen_robot and justsomeguy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.