大家好模型,我给在功能如下错误消息:数据
$query = $this->db->get();
$result = $query->result();
$data[] = $result;
但作为一个PHP错误遇到
严重性我得到的错误:请注意
消息:未定义变量:数据
文件名:型号/ survey_model.php
行号:845
空
什么是这一点。有人可以帮我请
function get_actual_details_model($fin_year,$state){
$this->db->select('*');
$this->db->from('survey_respondent_info');
$this->db->where('state', $state);
$queryYr = $this->db->get();
$resYr = $queryYr->result();
foreach ($resYr as $surveyId) {
$this->db->select('budgets.*, budget_funding.*, marketing_budget.*, personnel_budget.*, grants_budget.*');
$this->db->from('budgets');
$this->db->join('budget_funding', 'budget_funding.budget_id = budgets.budget_id', 'left');
$this->db->join('marketing_budget', 'marketing_budget.budget_id = budgets.budget_id', 'left');
$this->db->join('personnel_budget', 'personnel_budget.budget_id = budgets.budget_id', 'left');
$this->db->join('grants_budget', 'grants_budget.budget_id = budgets.budget_id', 'left');
$this->db->where('budgets.financial_year',$fin_year);
$this->db->where('budget_option_id', 1);
$this->db->where('survey_id', $surveyId->survey_id);
$data = array();
$query = $this->db->get();
$result = $query->result();
$data[] = $result;
}
return $data;
}
你在哪里设置$的数据? – Anigel
[PHP:“Notice:Undefined variable”和“Notice:Undefined index”]的可能重复(http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index) –