I understand, but there's a limit to the abilities of my ESP. :p
The message you're seeing is apparently being generated by an echo/print, e.g.:
echo mysql_error();
You can simply search your source code for "mysql_error", and where you find it being used in such a manner, change it to something like:
user_error(mysql_error());
I'm afraid that's all I can think of.