我有我的代碼的問題,我得到的錯誤:錯誤笨:過多的連接數據庫
too many connection database.
這是我的控制器
class Api extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('Application_model', '', TRUE);
}
public function index()
{
echo "Access Denied";
}
public function application_detail($application_key = null)
{
$response['isSuccess'] = false;
$response['message'] = "data not found";
if ($application_key != null) {
$application = $this->Application_model->get_application_detail($application_key);
if ($application != null) {
$response['isSuccess'] = true;
$response['message'] = "data found";
$response[$application_key] = $application->$application_key;
}
}
echo json_encode($response);
}
}
,這是模型:
class Application_model extends CI_Model
{
function get_application_detail($application_key)
{
$this->db
->select($application_key);
$this->db->from('application');
$query = $this->db->get();
return $query->row();
}
}
那麼如何解決它?
什麼是「pconnect」值。你改變了什麼嗎?在database.php文件 – Sundar