468,107 Members | 1,253 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

php and mysql escape characters

Everytime I want to enter to a textbox area "it's fun" (no quotes) I get an error.

"Problems with Query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's fun'"

I need to enter " it\'s fun" (no quotes) in order for MySql accept it.

Any work arounds on escape characters? How can I have mySQL just take "it's fun" just like that?
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Dec 11 '05 #1
1 11419
el chupacabra wrote:
Everytime I want to enter to a textbox area "it's fun" (no quotes) I get an error. Any work arounds on escape characters? How can I have mySQL just take "it's fun" just like that?


$text = mysql_real_escape_string($text_from_form);

now $text should be safe to insert into the sql
Dec 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Archibald | last post: by
10 posts views Thread by John Smith | last post: by
19 posts views Thread by cover | last post: by
7 posts views Thread by Paul Furman | last post: by
3 posts views Thread by Taras_96 | last post: by
11 posts views Thread by macca | last post: by
9 posts views Thread by PI | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.