Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySql: blobs

Status
Not open for further replies.

aarushi2001

Technical User
Nov 16, 2005
109
US
Hi, I have a user form, which requires user to enter data. This field has been defined as 'blob'. The problem is if my textarea consists of ',' or ''' or '"', it gives an error.

How can I avoid this error?
 
The problem would lie in the program code used to process the form data and compose the SQL query to update the database. You would need to check that code to ensure that the characters entered are properly escaped for use in an SQL string.
 
Thanks Tony,

I was thinking when I update my table, a problem cud be there.

Sorry, but for first time I am encountering this problem.. do I need to catch this error.. or basically ask the code to ignore the escape characters? How can I do it?
 
You have a few options -
- reject the form data back to the user
- strip out the offending characters from the text
- escape them as described in the manual, at .

The first option might be difficult for the user to understand, the second could result in strange-looking data being saved, so the third is probably the best. The details of how to do it depend on your programming interface.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top