Welcome Guest, Not a member yet? Register   Sign In
Data type changes when selecting using Active Record
#3

[eluser]Atharva[/eluser]
First of all, why are you returning records with result() function when you just need a single row? Try this:

Model
Code:
function item_detail ($item_id)
{
$query = $this->db->get_where('items',array('item_id' => $item_id));
return ($query->row());
}

Controller
Code:
$data['this_item'] = $this->Item_model->item_detail($item_id);
$this->load->view('item_edit_v.php', $data);

Not sure this will solve your problem but this is much better than your code.


Messages In This Thread
Data type changes when selecting using Active Record - by El Forum - 12-04-2010, 08:23 PM
Data type changes when selecting using Active Record - by El Forum - 12-05-2010, 01:05 PM
Data type changes when selecting using Active Record - by El Forum - 12-05-2010, 11:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB