public function __CONSTRUCT($options, $conf = array()) { ecpimport("database.query"); $this->_conf = $conf; self::$_prefix = array_key_exists("prefix", $options) ? $options["prefix"] : "e_"; $this->_conf['prefix'] = self::$_prefix; self::$_host = array_key_exists("host", $options) ? $options["host"] : "localhost"; if (!array_key_exists("user", $options) || !array_key_exists("password", $options) || !array_key_exists("database", $options)) { $this->addError("ECP_DATABASE CONSTRUCTOR"); } else { self::$_user = $options["user"]; self::$_pasw = $options['password']; self::$_db = $options['database']; } $this->con = mysql_connect(self::$_host, self::$_user, self::$_pasw); mysql_select_db(self::$_db, $this->con); }