I would like to encode text data when updating and inserting to a mysql table. The reason I want to do this is I get syntax errors for example when the text string contains these characters e.g. ' , ). I guess my question is can this be done with encode? and if so what is the actual syntax? And can the text be decoded with a PHP script? Or is there a better way of getting around this.