Your problem is that you can only have one active connect to a database at the same time. Both the $db1 and $db2 variables are identifiers pointing to the same server, so only the latest mysql_select_db() statement is used. You will, instead, need to do this:
// -- start code --
$db = mysql_connect("host", "user", "pass");
$sql = "select * from users";
mysql_select_db("DB1", $db);
$r1 = mysql_query($sql, $db);
mysql_select_db("DB2", $db);
$r2 = mysql_query($sql, $db);
echo mysql_num_rows($r1) . "<br>";
echo mysql_num_rows($r2) . "<br>";
// -- end code --
I think that will work, unless you are working with 2 different servers, which I doubt. Hope this helps.