Welcome Guest, Not a member yet? Register   Sign In
Data population in form_dropdown
#1

[eluser]Unknown[/eluser]
My model code is

$this->db->select('makeId','makename');
$this->db->from('lk_make');
$this->db->where('status','0');

$query = $this->db->get();
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
line 249 -------------- $options[ $row['makeId'] ] = $row['makename'];
}
return $options;
}

My Controller code is

$data['lkmake'] = $this->ads_model->Getmake(); //make
$this->load->view('ads/ad_add_form',$data);

My view code is
<?=form_dropdown('makeId',$lkmake)?>


But i am still getting an error "Fatal error: Cannot use object of type stdClass as array in C:\xampp\htdocs\dev.com\system\application\models\ads_model.php on line 249"

i am newbie in CI world please guide where i am doing wrong.


Messages In This Thread
Data population in form_dropdown - by El Forum - 04-14-2010, 02:03 AM
Data population in form_dropdown - by El Forum - 04-14-2010, 02:23 AM
Data population in form_dropdown - by El Forum - 04-14-2010, 02:32 AM
Data population in form_dropdown - by El Forum - 04-14-2010, 02:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB