コード例 #1
0
ファイル: model2.class.php プロジェクト: zhouzhouxs/Progect
 public function __construct($db_config = '', $table_name = '')
 {
     //4.13  增加M函数功能,无需model文件也能操作数据库了
     $this->db_config = $db_config ? $db_config : $this->db_config;
     //4.13
     $this->table_name = $table_name ? $table_name : $this->table_name;
     //4.13
     if (!isset($this->db_config[$this->db_setting])) {
         $this->db_setting = 'default';
     }
     $this->table_name = $this->db_config[$this->db_setting]['tablepre'] . $this->table_name;
     $this->db_tablepre = $this->db_config[$this->db_setting]['tablepre'];
     $this->db = db_factory::get_instance2($this->db_config)->get_database($this->db_setting);
     //
 }