本文整理汇总了PHP中db_factory::get_instance2方法的典型用法代码示例。如果您正苦于以下问题:PHP db_factory::get_instance2方法的具体用法?PHP db_factory::get_instance2怎么用?PHP db_factory::get_instance2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db_factory
的用法示例。
在下文中一共展示了db_factory::get_instance2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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);
//
}