[ciapug] Cleaning data for db storage

Chris Hettinger ciapug@cialug.org
Fri, 19 Mar 2004 09:35:35 -0600


For the best results what should I do to deal with unfriendly characters 
submitted in form data when the data is going to be store in a database?

My current situation is that I have to do something about the apostrophe 
and ampersand used in text fields because it is causing errors when that 
data is put through a db insert or update statement.

I can't strip them completely, is there a "best practice" to follow when 
dealing with this? How do others work with them?

-ch