Ugh, I'll probably struggle with this until my last day. I always get stuck on this when I write an app. Maybe someone can help educate me here.
I'm coding a PHP/MySQL based HTML GUI to SELECT a TEXT field from a table, edit it, and then UPDATE/INSERT it back into the table (data is passed via a POST). The TEXT data contains all sorts of special characters though. Semicolons and Dollar Signs are giving me the most trouble right now. Can anyone help me figure out why I continue to corrupt my TEXT data by doing multiple SELECTs and UPDATEs of the same data in succession? When do I need to addslashes(), stripslashes(), etc. etc? Also, how do I deal with special line returns ("\n\r") and other characters like semi-colons and dollar signs?
Any help would be appreciated. Thanks
-James
P.S. My form is a Smarty template so I use {$smarty.post.textdata|stripslashes} to display in the form, if that matters.