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

[eluser]mingquel[/eluser]
So I don't know if the title really describes the problem, but I had to put something. So the problem we're having is, we have to two databases that we've inner joined but need to print out a certain amount to the view. As it stands now, when the view is loaded, the user sees just the category links. When you view the source, you see the category links as well as an id that corresponds to the category links, but you also see the one hundred and three Terms and Definitions. The issue is, for every category id, it's printing out all one hundred and three Terms/Definitions. How would we go about getting it to print out only the Terms/Definitions that relate to a specific category id? Here is the code for the view:
Code:
<div id="main-content-wrap" class="content">
    <h1>Glossary of Real Estate Terms</h1>
    <div id="glossary">
        <div class="nav-glossary">
            <ul id="internalnav">
                &lt;?php foreach ($blubs as $blub): ?&gt;
                <li><a href="#">&lt;?php echo $blub->gl_categories ?&gt;</a> &middot; </li>
                &lt;?php endforeach; ?&gt;
            </ul>
        </div>
        &lt;?php foreach ($blubs as $blub): ?&gt;
        <div class="section" id="&lt;?php echo $blub->gl_categories ?&gt;">
        <dl>
            &lt;?php foreach ($blobs as $blob): ?&gt;
            
                <dt>&lt;?php echo $blob->Term ?&gt;</dt>
                <dd>&lt;?php echo $blob->Definition ?&gt;</dd>

            &lt;?php endforeach; ?&gt;
            </dl>
            </div> &lt;!-- end section --&gt;&lt;?php endforeach; ?&gt;

    </div>
</div>
<div id="menu-generic">
    &lt;?php $this->load->view('sidebar-generic'); ?&gt;
</div>

Any help would be appreciated. Feel free to ask for more information. Thanks.


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