vendredi 4 avril 2008

Wordpress and mysql_affected_rows

After my server upgrade, I noticed a strange problem that arises only after publishing/updating posts. Every time, I get many errors of this kind :

Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /home/path_to_my_blog/wp-includes/wp-db.php on line 183


But, the publish/update action if actually executed ! So I tried to get in the code and just replacing this line
$this->rows_affected = mysql_affected_rows();

by this one
$this->rows_affected = mysql_affected_rows($this->dbh);

solved the problem.

Is it so difficult for the Wordpress Team to put explicitly connection link to the database server ?