06-10-2008, 04:28 AM
|
#5 (permalink)
|
|
The Gregarious
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
|
I haven't tested this, but maybe you could try it?
PHP Code:
public function connect() { static $host = 'localhost'; static $user = 'SpYkE112'; static $pass = ''; static $name = array( 0 => 'dev1', 1 => 'pureftpd' ); global $p101; switch($this->db) { case 'mysql': foreach($name as $val) { $this->link[$val] = mysql_connect($host, $user, $pass, true); if (!$this->link[$val]) { $p101->error[] = 'Unable to connect to database! ' . $val . '!'; return false;
} else { if (!mysql_select_db($val, $this->link[$val])) { $p101->error[] = 'Unable to select database: ' . $val . '!'; return false; } } // if } // foreach } // switch
}
|
|
|
|