09-17-2007, 07:22 PM
|
#13 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
PHP Code:
/**
||||||||||||||||||||||||||||||||||||||||||
|||| Our constructor that auto-loads
||||||||||||||||||||||||||||||||||||||||||
**/
private function __construct($host, $user, $pass) {
if(strlen($host) > 0 && strlen($user) > 0 && strlen($pass) > 0) {
$this->db['host'] = $host;
$this->db['user'] = $user;
$this->db['pass'] = $pass;
$this->connectdb();
} else {
$this->connectdb();
}
}
I think this could be further made shorter into the following because even though it doesn't pass the strlen function, it still tries to connect to the database.
PHP Code:
/**
||||||||||||||||||||||||||||||||||||||||||
|||| Our constructor that auto-loads
||||||||||||||||||||||||||||||||||||||||||
**/
private function __construct($host, $user, $pass) {
$this->db['host'] = $host;
$this->db['user'] = $user;
$this->db['pass'] = $pass;
$this->connectdb();
}
|
|
|
|