php and mysql escape characters

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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?

--------  Binary Usenet downloading made easy =---------
-=  Get GrabIt for free from =-

Re: php and mysql escape characters

el chupacabra wrote:
Quoted text here. Click to load it

$text = mysql_real_escape_string($text_from_form);

now $text should be safe to insert into the sql

Site Timeline