Example #1
0
 /**
  * [__construct 自动组合表名并连接数据库初始化sql]
  * @param [type] $table [description]
  */
 public function __construct($config = array(), $table = NULL)
 {
     $this->table = is_null($table) ? $this->dbPrefix . $this->table : $this->dbPrefix . $table;
     //初始化数据库信息
     $dbdefault = array('DB_HOST' => '127.0.0.1', 'DB_USER' => 'root', 'DB_PASSWORD' => 'root', 'DB_PORT' => '3306', 'DB_DATABASE' => 'test', 'DB_CHARSET' => 'utf8');
     self::$dbConfig = array_merge($dbdefault, $config);
     //连接数据库
     $this->_connect();
     //初始化sql信息
     $this->_opt();
 }