Welcome Guest, Not a member yet? Register   Sign In
Call to a member function field_data() on a non-object (plugin to excel)
#1

[eluser]Unknown[/eluser]
Hay guys…


I’m beginner in using CI.. could you help me to find this plugin to excel trouble..
I really don’t know why.. please help me..


here’s my script

// Controller

function export()
{

$year_x= trim($this->input->post(‘year’,TRUE));
$month_x= trim($this->input->post(‘c_month’,TRUE));
$unit_x = trim($this->input->post(‘c_unit’,TRUE));

$file_name = $month_x.’‘.$year_x;
$query = $this->mod_export->export_data($unit_x,$year_x, $month_x);
to_excel($query, $file_name);


$this->session->set_flashdata(‘message’,‘Has Already Verified’);
redirect(‘export_Ok/export/’,‘refresh’);

}

//model


function export_data($unit_x,$year_x, $month_x)
{
$q=“Select * from record_data where unit =” .”’$unit_x’”. “AND year_Ok=” .”’$year_x’”. “AND month_ok =” .”’$month_x’”.;
$sql= $this->db->query(”$q”);
return $sql->num_rows();

}



Thanks A lot




Theme © iAndrew 2016 - Forum software by © MyBB