Welcome Guest, Not a member yet? Register   Sign In
me failing with $query->result()
#5

[eluser]devvee[/eluser]
Thanks for the responses! I actually tried the answer given in the first reply before and it didn't work, but that's probably due to a typo on my end because it works like a charm now Smile

[quote author="Skootz 25" date="1241730521"]I would do...

IN YOUR CONTROLLER:
foreach ($query as $row)
{
$data['somefield'] = $row->somefield;
}
$this->load->view('some_view', $data);

IN YOUR VIEW:
<?=$somefield?>

This will gather all your data from your loop attaching it to $data[]. Then you just echo it out where ever seems fit.

Cheers.[/quote]
You'd still need some kind of loop when multiple rows are returned, but it's definitely a nice option if you only need one row of information Smile


Messages In This Thread
me failing with $query->result() - by El Forum - 05-07-2009, 08:08 AM
me failing with $query->result() - by El Forum - 05-07-2009, 08:13 AM
me failing with $query->result() - by El Forum - 05-07-2009, 08:15 AM
me failing with $query->result() - by El Forum - 05-07-2009, 10:08 AM
me failing with $query->result() - by El Forum - 05-07-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB