off the top of my head this should work, just add it in place of your current db connection lines. and insert valid user/passwords etc.
I would test it but i dont have time to play, have a go (and make sure you backup your current index files that you change)
Code:
<?
$verified = false;
$test = 0;
$userdata = array("username" => "user0",
"password" => "pass0"
);
while(!$verified) {
if($db_con = mysql_connect("hostname", $userdata['username'], $userdata['password'])) {
mysql_select_db("yarrs_forum_db", $db_con);
$verified = true;
}
else {
list($userdata['username'], $userdata['password']) = change_db_user($test);
$test ++;
if($test == 5) {
die("All available user/password combinations have been tested and failed!!!");
}
$verified = false;
}
}
function change_db_user($counter) {
$rtn = array();
$usernames = array("user1", "user2", "user3", "user4", "user5", "user6");
$passwords = array("pass1", "pass2", "pass3", "pass4", "pass5", "pass6");
return array($usernames[$counter], $passwords[$counter]);
}
?>