[eluser]dallen33[/eluser]
Well, I do know how to return it, but I'm clearly doing something wrong. So in my database model:
Code:
$this->db->insert('online_booking', $form_data);
$booking_id = $this->db->insert_id();
return $booking_id;
Simple enough. In my controller, though, I want to do this:
Code:
if ($this->form_model->online_booking($this->input->post())):
$this->data['order'] = $this->db->get_where('online_booking', array('id' => $id))->row();
Instead of having $id in my query, I want to get the returned value of my database model. I've tried doing this:
Code:
$this->data['order'] = $this->db->get_where('online_booking', array('id' => $this->form_model->online_booking($this->input->post())))->row();
But I assume that means it's actually doing the query twice. Which I don't want.
What's the proper way to do this?