View Single Post
Old 04-15-2009, 11:06 PM   #1 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default What am I doing wrong here?

PHP Code:
    public function __construct() {
        
$this->dbError '';
        
$this->link null;
    }
    
    
    public function 
dbConnect$config['host'], $config['user'], $config['pswd'], $config['name'] ) {
        
$this->link mysqli_connect($config['host'], $config['user'], $config['pswd'], $config['name']);
        if(
mysqli_connect_errno($this->link)) {
            
$this->dbError mysqli_connect_error($this->link);
            return 
false;
        } else {
            return 
true;
        }
        
    } 
This line:
PHP Code:
    public function dbConnect$config['host'], $config['user'], $config['pswd'], $config['name'] ) { 
gives me the following error:
Quote:
Parse error: syntax error, unexpected '[', expecting ')'
What am I doing wrong? :(
Sam Granger is offline  
Reply With Quote