Hello,
Can anyone tell me how to safely add a ' to a mysql database, the way we have it now, we have the ' stripped out using the following code:
$zipcode =~ s/\s/\'/g;
$zipcode =~ s/\'/ /g;
But I'm wondering how to safely let the users use the single quote as we do get a lot of people that write messages back and forth to other members with things like, don't and won't and couldn't and I'm, so Im wondering if there is someway of doing this that will allow the mysql database to accept the ' when inserting the information, I believe it's okay to have a ' inside of the database once it's there, just not acceptable to actually put it in via a form submital. If we don't strip out the ' then the information never gets written to the database and I assume that's because of mysql and corruption issues with the ' character being as how that's used in routines to search the database.
Any clues?
Harrison
"I've got if's pretty good, but that's about it"
Can anyone tell me how to safely add a ' to a mysql database, the way we have it now, we have the ' stripped out using the following code:
$zipcode =~ s/\s/\'/g;
$zipcode =~ s/\'/ /g;
But I'm wondering how to safely let the users use the single quote as we do get a lot of people that write messages back and forth to other members with things like, don't and won't and couldn't and I'm, so Im wondering if there is someway of doing this that will allow the mysql database to accept the ' when inserting the information, I believe it's okay to have a ' inside of the database once it's there, just not acceptable to actually put it in via a form submital. If we don't strip out the ' then the information never gets written to the database and I assume that's because of mysql and corruption issues with the ' character being as how that's used in routines to search the database.
Any clues?
Harrison
"I've got if's pretty good, but that's about it"