I figured this problem out finally, but just in case this helps anyone else out I will post what was going on.
The magic_quotes was enabled and causing the extra \ to be placed on the queries. I had to disable the magic_quotes in the php.ini file and then restart the server. The php.ini file should look like this:
; Magic quotes
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
Thanks for everyone's help.