recently after installing a plugin i got an error from WordPress that looked something like this.
Warning: mysql_error(): X is not a valid MySQL-Link resource in (path) on line Y
(Warning: mysql_error(): 9 is not a valid MySQL-Link resource in /var/www/vhosts/XXX/httpdocs/wp-includes/wp-db.php on line 282)
i found the solution here and thought that i might post the fix
http://scripts.indisguise.org/2007/04/05/using-non-plugin-third-party-scripts-with-wordpress-212/

Subscribe