mattheww Posted December 18, 2009 Share Posted December 18, 2009 Basically I have a text area, a query to send the data to the table, etc, etc... but the problem is, MySQL won't allow certain characters, for example the Apostrophe. I know this stops people doing MySQL injection, but how do I get it so PHP or MySQL replaces the character for something else, and then converts it back when I query it? Quote Link to comment https://forums.phpfreaks.com/topic/185658-how-do-i-get-mysql-to-allow-all-characters/ Share on other sites More sharing options...
premiso Posted December 19, 2009 Share Posted December 19, 2009 You want to look into mysql_real_escape_string onto data going into the database will do what you want and you do not have to worry about changing anything or modifying data when pulling it out. Quote Link to comment https://forums.phpfreaks.com/topic/185658-how-do-i-get-mysql-to-allow-all-characters/#findComment-980336 Share on other sites More sharing options...
trq Posted December 19, 2009 Share Posted December 19, 2009 mysql_real_escape_string should be used on all variables used within queries. Quote Link to comment https://forums.phpfreaks.com/topic/185658-how-do-i-get-mysql-to-allow-all-characters/#findComment-980337 Share on other sites More sharing options...
mattheww Posted December 19, 2009 Author Share Posted December 19, 2009 Thanks guys, that helped! Quote Link to comment https://forums.phpfreaks.com/topic/185658-how-do-i-get-mysql-to-allow-all-characters/#findComment-980343 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.