function __construct($conf) { parent::__construct(); foreach ($conf as $key => $value) { $this->{$key} = $value; } }
function __construct($db) { parent::__construct(); $this->link = mysql_connect($db['host'], $db['user'], $db['password']) or die('Could not connect to MySQL database'); mysql_select_db($db['db'], $this->link); mysql_query('SET NAMES utf8', $this->link); }