View Single Post
Old 04-11-2007, 10:01 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by Jace View Post
Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /wp-includes/wp-db.php on line 18
79 function escape($string) {
80 return addslashes( $string ); // Disable rest for now, causing problems
81 if( !$this->dbh || version_compare( phpversion(), '4.3.0' ) == '-1' )
82 return mysql_escape_string( $string );
83 else
84 return mysql_real_escape_string( $string, $this->dbh );
85 }

This code is broken. It depends on your PHP version for what calls are actually evaulated, so 'line 18' is not necessarily correct.

The code around line 18x, however, is for the whole 'Query' wrapper. It's hard to tell what's wrong with that without actually stepping through it. I don't do those kinds of repairs for free.. I can't afford to.

mysql_escape_string() and mysql_real_escape_string() do not work unless you have already connected to the database. Either there's a problem connecting to the database, as it states, or it's trying to use the above function before it has actually connected. This is a "race condition", and has nothing to do with Imus.

A really awful fix would be to replace your call to addslashes(), but the proper fix is to connect to the DB first.

Quote:
Originally Posted by jact View Post
Any ideas?
You have something sending data before it's able to properly tag/set cookies/other data. Look for either a hard return in a new add-on, your template above your <html>, scripts with this on top (index.php/wp-rss2.php), or any include files which may have caused this. It's usually due to editing a file by hand or uploading with the wrong type (binary instead of ascii).
__________________

Last edited by GrouchyAdmin; 04-11-2007 at 10:03 PM..
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote