Hi, 
 
I am trying to insert a paragraph from a <textarea> field on a form.
This form is part of a CGI script that then inserts the textarea data
into a MySQL database table through DBI. The problem is that when the
paragraph contains an apostrophe, eg. 'The script won't work' then the
row will not insert and I get an error "You have an error in your SQL
syntax near 't at line ..." But if I do not put the apostrophe, it works
fine. In the insert statement I insert the data by using a variable
name, eg. '$textfield' not 'The script won't work'  
 
Is there an escape function that I can use on the variable name? or
maybe something else that I am missing? 
 
Thanks, 
 
Emma
 


Reply via email to