Welcome Guest, Not a member yet? Register   Sign In
SQL query
#3

Hi hipm, the examples provide by https://stackoverflow.com/questions/4875...es/4876589 doesn't work for me. please look my controller and my model codes and explain me why it doesn't work. thanks for your answers.

This is my mode

public function getRecordsKpicon( $data ){
$this->db->select('station_nom, kpi_cate, kpi_nom, kpi_valeur, kpi_date, kpi_heure');
$this->db->from('kpi');
$this->db->join('station_base', 'station_base.station_id = kpi.station_id');
$this->db->where( $data );
$query = $this->db->get();
return $query->result();
}

and this is my controller

ublic function viewconsukpi(){

$data = array('type_reseau' => $this->input->post('type_reseau'), 'kpi_type'=> $this->input->post('kpi_type'), 'kpi_nom'=> $this->input->post('kpi_nom'), 'region'=> $this->input->post('region'), 'ville'=> $this->input->post('ville'), 'centre'=> $this->input->post('centre'), 'site'=> $this->input->post('site'), 'kpi_date <='=> $this->input->post('datedebut'), 'kpi_date >='=> $this->input->post('datefin')
);
$this->load->model('Kpimodel');
$records = $this->Kpimodel->getRecordsKpicon( $data );
$this->load->view('kpilist', ['records'=>$records]);


}
Reply


Messages In This Thread
SQL query - by ben beker - 05-26-2018, 07:52 AM
RE: SQL query - by hipm - 05-26-2018, 09:35 PM
RE: SQL query - by ben beker - 05-28-2018, 12:42 AM
RE: SQL query - by ben beker - 05-29-2018, 12:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB