Hello friends, it turns out that I have this information in the table:
and with CodeIgniter I need to bring all the data of id_servicio
entered.
the code I have is this:
In the model:
function getcoffeInfo ($id_servicio){
$this->db->select('*');
$this->db->where('id_servicio',$id_servicio);
$query = $this->db->get('Coffemovil');
return $query->row();
}
and in controller:
public function getCoffeDate(){
$new_id = $this->input->post('id_servicio');
$this->load->model('Model_app');
$data = $this->Model_app->getcoffeInfo($new_id);
header('Content-Type: application/json');
echo json_encode($data);
}
The problem is that it only returns a single data and no more, I want all 54
for example!
What am I doing wrong? Greetings.