Welcome Guest, Not a member yet? Register   Sign In
Showing data in a loop, view, controller, model
#2

[eluser]SitesByJoe[/eluser]
You need to do something like this:

Code:
<?php
foreach ($brands->result() as $brand)
{
    echo $brand->name;
    foreach ($models->result() as $model)
    {
        if ($model->brand_id == $brand->id)
        {
            echo $model->name;
        }
    }
}
?>


Messages In This Thread
Showing data in a loop, view, controller, model - by El Forum - 07-24-2011, 01:14 PM
Showing data in a loop, view, controller, model - by El Forum - 07-24-2011, 08:47 PM
Showing data in a loop, view, controller, model - by El Forum - 07-24-2011, 08:47 PM
Showing data in a loop, view, controller, model - by El Forum - 07-24-2011, 09:46 PM
Showing data in a loop, view, controller, model - by El Forum - 07-24-2011, 10:52 PM
Showing data in a loop, view, controller, model - by El Forum - 07-25-2011, 05:01 AM
Showing data in a loop, view, controller, model - by El Forum - 07-25-2011, 07:15 AM
Showing data in a loop, view, controller, model - by El Forum - 07-26-2011, 09:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB