我有一个工作得很好的功能。然后我将它上传到实时服务器,它给了我一个 500 内部服务器错误。在谷歌搜索之后,人们说当某些东西(但他们不确定是什么)被服务器弄乱时,你会得到一个错误。不是很有帮助。其他人说检查你的错误日志。我不知道怎么去。
导致错误的函数================================
private function get_workstation () {
//================ I tried deleting all but this and that got rid of the error== //
if ($this->input->post('search')) {
$search = $this->input->post('search');
$where = 'ad_name ="'.$search.'" AND';
$this->data['search'] = $search;
} else {
$where = '';
}
// ================================================================= //
// Pagination Code //
$numOfRows = $this->db->query('
SELECT distinct sys_name
FROM v_rollout_sysuser
WHERE scope_ID = '. $this->session->userdata('scopeId') .'
');
if ($this->input->get('page')) {
$pageNum = $this->input->get('page');
} else {
$pageNum = 1;
}
$limit = ($pageNum - 1 ) * 50;
$numRows = $numOfRows->num_rows();
$totalPages = ceil($numRows / 50);
$this->data['pageNum'] = $pageNum;
$this->data['prevPage'] = $pageNum - 1;
$this->data['nextPage'] = $pageNum + 1;
$this->data['totalPages'] = $totalPages;
// End of Pagination Code //
$query = $this->db->query('
SELECT *
FROM v_rollout_sysuser
WHERE '.$where.' scope_ID = '. $this->session->userdata('scopeId') .'
GROUP BY sys_name
LIMIT '.$limit.',50');
$i = 0;
foreach ($query->result() as $row) {
$i = $i + 1;
$data['i'] = $i;
$data['ro_ID'] = $row->ro_ID;
$data['sys_name'] = $row->sys_name;
$data['EAM_Model'] = $row->EAM_Model;
$data['EAM_User'] = $row->ad_account;
$data['ad_DispName'] = $row->ad_DispName;
$data['search'] = $this->input->post('search');
$systems[] = $data;
}
if(isset($systems)) {
$this->data['systems'] = $systems;
} else {
$this->data['systems'] = null;
}
}