Good day! I study OOP on php model MVS codeigniter framework.

I have a model

public function numb_vagon($number_vagona) { $this->db->order_by('disla_date'); $this->db->where('number_vagona', $number_vagona); $res = $this->db->get($this->_table); if ($res) { return $res->result(); } else { return false; } 

there is a controller

 public function HistoryWagonResult() { $query = $this->Unload_model->numb_vagon($number_vagona); $data['query'] = $query; $this->load->view('pages_view/history_vagon_result_view', $data); } 

and also view

 <? foreach ($query as $row): ?> <tr> <td><?=$row->naznachenie ?></td> <td><?=$row->operation ?></td> <td><?=$row->date ?></td> <td><?=$row->time ?></td> <td><?=$row->op ?></td> <td><?=$row->dpr ?></td> <td><?=$row->index_poezd ?></td> <td><?=$row->gruz ?></td> <td><?=$row->ves ?></td> <td><?=$row->grpol ?></td> </tr> <? endforeach; ?> 

The essence of the work I enter in the search box number of the car, and I have to output the result in the table, naturally, errors are given for $ number_vagona. I can do it on pure php. but now I need to implement on codeigniter how the variable is transmitted correctly, I just don’t understand, in general, how to describe $ number_vagona and where

    1 answer 1

     $number_vagona = $this->input->post('nomer_vagona'); 

    did not describe in the controller, now everything works