how do I get rid of an apostrophe with php?

I have a php query and it's submitting the info to the database the problem is is if there is an apostrophe in the information that the client submits it messes up the query. Is there a way to strip out the apostrophe from the query?
Who is Participating?
It depends on your database engine. If you're using MySQL then you could use mysql_real_escape_string function:

And for PostgreSQL, use  pg_escape_string:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.