I was looking through the docs and stumbled onto mysql_real_escape_string() and I’m not understanding why it’s useful when you can just addslashes(). Can someone show me a scenario as to why it’s useful?
I’m also curious why it requires a database connection…. that seems like a lot of overhead.
There is a great article about this here. And this discussion also points out the pros and cons of each solution.