I need to add a bunch of custom fields in a certain application. All fields need to be validated, but obviously, I want to validate them in such a way that MySQL (the backend database) doesn't get hacked or ..., you know, manipulated. What do I need to do in order to prevent this from happening? (By the way, the application that I''m modifying is Coppermine Photo Gallery and I'll just following the following mod to do this: http://coppermine-gallery.net/forum/index.php?topic=35263.0 So, basically, I'm trying to figure out if this mod is sufficient for the data validation or I need to add more code to ensure that the application doesn't get hacked or anything like that.)
All user input, before using it in a query, must be validated with mysql_real_escape_string. (can't give you the link yet (forum rules) but you'll find it in the php documentation at php.net)