Welcome Guest, Not a member yet? Register   Sign In
Multiple Queries
#1

[eluser]timboland[/eluser]
I have a grid of info that I need to display, most of these values are stored in 1 table but there is 1 column that has many values and stored in a child table. What is the best way to handle this in a MVC system?


Code:
//controller
//easy to get from one table
function list_topics()
{
$this->load->model('topic/Topic_model');
$data['query'] = $this->Topic_model->ReadAllTopics();
$this->load->view('manage/list_topic_view.php', $data);
}

//view
<?php
foreach($query->result() as $row)
{

    print "<tr class='rowstyle'>
        <td>$row->heading</td>
        <td>$row->description</td>
        <td>$row->isactive</td>
        <td>$row->sortnumber</td>";
    
    // HERE is where I need to print out the details child table
    // every row has different child records
    // What is the best way to dip into the database & pull these records?
    // Do I do it in the view?    

    print"<td><a >Manage Image</a></td></tr>";
                
        
}
print "</table>";
?&gt;


Messages In This Thread
Multiple Queries - by El Forum - 05-04-2009, 08:41 AM
Multiple Queries - by El Forum - 05-04-2009, 05:07 PM
Multiple Queries - by El Forum - 05-04-2009, 07:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB