The call to mysql_real_escape_string can fail because it tries to initiate a new database connection (with missing credentials) instead of using the one that the wpdb object created.
To prevent situations like this one, the other mysql_... calls in the code should also be replaced with the appropriate method calls on the $wpdb global.
The call to
mysql_real_escape_string
can fail because it tries to initiate a new database connection (with missing credentials) instead of using the one that the wpdb object created.To prevent situations like this one, the other
mysql_...
calls in the code should also be replaced with the appropriate method calls on the$wpdb
global.