Link to home
Create AccountLog in
Avatar of anotherdotcommer
anotherdotcommer

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of AriMc
AriMc
Flag of Finland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
And for PostgreSQL, use  pg_escape_string:

http://www.php.net/manual/en/function.pg-escape-string.php