Welcome Guest, Not a member yet? Register   Sign In
Trying to figure out how to use db->where... does my code make sense?
#3

[eluser]dallen33[/eluser]
Alright, I think I figured it out, but let me know if I can do this more efficiently.
Code:
<?    if ($ads_query->num_rows() > 0): ?>

    <?    foreach($ads_query->result() as $ads_row): ?>
    
    <?    $clients_query = $this->db->get_where('clients', array('id' => $ads_row->client));
        $clients_row = $clients_query->row();
    ?>
    
        <div style="border:1px solid black; padding:10px; margin-bottom:10px;">
            <p>&lt;?=$clients_row->name?&gt;</p>
            <p>&lt;?=$ads_row->run_date?&gt;</p>
            <p>&lt;?=$ads_row->notes?&gt;</p>
        </div>
    
    &lt;?    endforeach; ?&gt;

&lt;?    endif; ?&gt;

Seems to work...


Messages In This Thread
Trying to figure out how to use db->where... does my code make sense? - by El Forum - 10-01-2008, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB