Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v
retrieving revision 1.28
diff -u -F^f -r1.28 database.mysql.inc
--- includes/database.mysql.inc	14 Apr 2005 18:50:16 -0000	1.28
+++ includes/database.mysql.inc	10 May 2005 20:14:32 -0000
@@ -28,7 +28,12 @@ function db_connect($url) {
      $url['host'] = $url['host'] .':'. $url['port'];
   }
 
-  $connection = mysql_connect($url['host'], $url['user'], $url['pass'], TRUE) or die(mysql_error());
+  // TRUE makes mysql_connect() always open a new link, even if
+  // mysql_connect() was called before with the same parameters.
+  // This is important if you are using two databases on the same server.
+  // 2 means CLIENT_FOUND_ROWS: Return the number of found (matched) rows,
+  // not the number of affected rows
+  $connection = mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2) or die(mysql_error());
   mysql_select_db(substr($url['path'], 1)) or die('unable to select database');
 
   return $connection;
