Welcome Guest, Not a member yet? Register   Sign In
Grabbing and printing from database into a view
#2

[eluser]Jeremy Gimbel - Conflux Group[/eluser]
I would think you'd want to use a conditional inside of the second foreach that tests whether the given term is related to the category.

Something like:

Code:
<?php foreach ($blobs as $blob): ?>
         <?php if($blob->category ==  $blub->gl_categories):?>  
                <dt>&lt;?php echo $blob->Term ?&gt;</dt>
                <dd>&lt;?php echo $blob->Definition ?&gt;</dd>
        &lt;?php endif;?&gt;
&lt;?php endforeach; ?&gt;


It might be better to address this issue from the model side, and actually insert the array of associated terms and definitions into each category array or object.


Messages In This Thread
Grabbing and printing from database into a view - by El Forum - 03-16-2010, 01:09 PM
Grabbing and printing from database into a view - by El Forum - 03-17-2010, 09:39 PM
Grabbing and printing from database into a view - by El Forum - 03-17-2010, 11:44 PM
Grabbing and printing from database into a view - by El Forum - 03-18-2010, 05:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB