apostrophe(')
i have a text field where user can key in some coments...
when user have key in something with an apostrophe(') in it, it generate sql error.....
how can i solved it?
i have a text field where user can key in some coments...
when user have key in something with an apostrophe(') in it, it generate sql error.....
how can i solved it?
Suzanne posted this at 02:34 — 7th March 2002.
She has: 5,507 posts
Joined: Feb 2000
text wrangle -- when the form is submitted, replace all ' with \' or with &rsquot; or whatever html entity you want to use.
THEN save it to the database.
Wil posted this at 09:35 — 7th March 2002.
They have: 601 posts
Joined: Nov 2001
Use the built-in MySQL Quote function to overcome this. In Perl, this would be something like:
$field = $dbh->quote($field);
OB_redemption posted this at 17:05 — 11th March 2002.
They have: 11 posts
Joined: Mar 2002
use addslashes()
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.