Results 1 to 3 of 3
Thread: help needed
03-29-2003, 06:32 PM #1SmithGuest
I am having a problem inserting something in to my comments table. It works fine unless some puts a " ' " mark. Not quotation but the other type of mark. Any solutions?
03-30-2003, 04:37 PM #2LogicGuest
:P That other mark is an apostrophe, and yes there is a solution... but we don't know what kind of database you're using, what language you're using, nothing... help us out a little more.
04-03-2003, 12:04 PM #3matt2kjonesGuest
right then, i am guessing ur using php
and im guessing the data with the ' in it is stored in a variable, correct?
what u need to do is simple, we will pretend the test is stored in a var called $horrible_text
now, its simple, just do this :
$nice_text = addslashes($horrible_text);
now insert $nice_text into the db, should work fine
then when the data is taken from the db to be displayed on a page, put it into a var, for example, called nice_text, and do this
$horrible_text = stripslashes($nice_text);
$horrible_text is now ready to be displayed again
if you are completly confused at my bad example, then message me and i will help u further