This function will convert characters that ODBC queries have trouble with (apostrophe, quotation mark, back slash) to their HTML special character equivalent before being sent through an SQL query. I wrote this function because the replace function included with PHP threw a lot of exceptions for me.