View Single Post
Old 06-10-2008, 04:28 AM   #5 (permalink)
delayedinsanity
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

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(
                        
=> 'dev1',
                        
=> 'pureftpd'
                        
);
    global 
$p101;
                        
    switch(
$this->db) {
        case 
'mysql':
            foreach(
$name as $val) {
                
$this->link[$val] = mysql_connect($host$user$passtrue);
                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


delayedinsanity is offline  
Reply With Quote