Forum Moderators: coopster

Message Too Old, No Replies

MySQL Problem: I want to insert a string that contains ' in my table.

For SQL the ' means the end of the string, but it is just a part of it.

         

Bigzed

9:21 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



Hi Guys,
I have a SQL query like this:
INSERT INTO keyword1 (keyword, number) VALUES ('$keyword', '$newnumber')

Now the variable $keyword looks sometimes like this: Bigzed's example
And SQL is having a problem with the ' because it thinks the string is over, but it isn't.

How can I solve this problem?

Thank you.

Bigzed.

MajdAA

9:22 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



read www.php.net/addslashes

Bigzed

10:08 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



thanks.