--- database.mysql.inc_old	2010-05-21 19:43:42.196956196 +0100
+++ database.mysql.inc	2010-05-21 19:45:47.086948982 +0100
@@ -194,8 +194,11 @@ function db_error() {
  * Determine the number of rows changed by the preceding query.
  */
 function db_affected_rows() {
-  global $active_db;
-  return mysql_affected_rows($active_db);
+	$info_str = mysql_info($$link);
+	if (ereg("Records: ([0-9]*)", $info_str, $count) == false) {
+		ereg("Rows matched: ([0-9]*)", $info_str, $count);
+	}
+   return $count
 }
 
 /**
