29 lines
732 B
PHP
29 lines
732 B
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Jeonghwa Koo
|
|
* Date: 2016-11-07
|
|
* Time: 오후 9:54
|
|
*/
|
|
class MY_Model extends CI_Model
|
|
{
|
|
protected $db_session = [];
|
|
protected $date;
|
|
/**
|
|
* MY_Model constructor.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->database();
|
|
$this->date = date('Y-m-d H:i:s');
|
|
}
|
|
|
|
protected function & getSession($config) {
|
|
if(!isset($this->db_session[$config]))
|
|
$this->db_session[$config] = $this->load->database($config, true) or die('Database Connection isn\'t established');
|
|
return $this->db_session[$config];
|
|
}
|
|
} |