August 2nd, 2000, 07:07 PM
Well while entering a new entry into my MySQL table I came across a problem. It seems every time I try to enter a ' (aposterphe) MySQL comes up with an error message. Is there a way to allow aposterphes in my tables? It is rather important because I store alot of review in my database which cantain alot of aposterphes.
August 2nd, 2000, 07:31 PM
If you were inserting a string named $val you could run a function called addslashes before you input it:
$val = addslashes($val)
If you are running the insert from the command line just stick a behind the apostrphe
August 2nd, 2000, 11:03 PM
I'm using a program called phpMyAdmin 2.0.5, I just click insert and it gives me a form so i can insert all the info into the table. I tried the ' and it diden't work, I still get the error message. I didn't get what you were talking about in the first thing u said I could do(I'm kinda new at this) any help would be appreciated.
August 2nd, 2000, 11:26 PM
I have the same program on one of my servers and I am able to add records with apostophes fine, maybe it is the type of field you have, what type of field are you trying to put the apostrophe in?
August 2nd, 2000, 11:32 PM
I'm using a program called phpMyAdmin 2.0.5, I just click insert and it gives me a form so i can insert all the info into the table.I tried the ' and it diden't work,
yea, you can escape from the special characters using "" slash in mysql also.you should put that before your "'".
"INSERT INTO tablename(fieldname) values ('i'm new to phppp.but i can't do it')";
i think that will work...
"The fear of the LORD is the beginning of knowledge..."
[This message has been edited by Shiju Rajan (edited August 02, 2000).]
August 3rd, 2000, 04:03 PM
Thanks for all the help, ' worked.