Welcome Guest, Not a member yet? Register   Sign In
Urgent!, urgent!, emerrrgency! creating two separate querys and passing their results to a view file
#3

[eluser]prog_boy[/eluser]
#Controller
Code:
function entries()
    {
        $data['blog']= $this->db->get('blogs');
        
        $this->load->view('entries',$data);
    }
#View
Code:
<?php foreach($blog->result() as $row):?>
        <h3>&lt;?=$row->title?&gt;</h3>
        <p class="date">Posted on &lt;?=date("l M jS, Y ".'@'." g:iA",strtotime($row->dateposted))?&gt;
        -by //This is where the problem is, the member_id is displayed
//but i really want the members name to display
//WHERE this member_id corresponds to the id field in the members table.
        &lt;?=$row->member_id;?&gt;
        </p>
    &lt;?php endforeach;?&gt;
Creating the SQL is no problem but passing it to the view is killing me.


Messages In This Thread
Urgent!, urgent!, emerrrgency! creating two separate querys and passing their results to a view file - by El Forum - 07-21-2010, 03:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB