little_webspinner Posted August 2, 2009 Share Posted August 2, 2009 I noticed something strange yesterday when I input data into mysql from php. Before inserting the information I performed addslashes on the data. I then checked the info with the Query Browser and I found that the data that was inserted in the operation did not appear to have slashes on the quotes. Is this normal? I thought it very odd. Does Mysql's query browser automatically disregard slashes when displaying data in db fields? This was something I had not noticed before. Is something amiss? Magic quotes are disabled in PHP btw. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 2, 2009 Share Posted August 2, 2009 Is this normal? Yes. The escape characters are only in the data in the query string (so that the special characters in the data don't break the syntax of the query) , not in the actual data in the database. addslashes() does not escape all the special characters that can break a query. You need to use mysql_real_escape_string() Quote Link to comment Share on other sites More sharing options...
little_webspinner Posted August 2, 2009 Author Share Posted August 2, 2009 Thanks for the reply and the heads up! How do I get a little solved icon? Oh well, I'll with the thumbs up! 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.