Welcome Guest, Not a member yet? Register   Sign In
Queery Model Action
#3

[eluser]CroNiX[/eluser]
Code:
$q = $this->db->select('name')->where('id', $id)->get('table');

$q will equal the result set here.  However, you can still run:
foreach($q->result() as $row)
{
    echo $row->name . '<br />';
}

$q = $this->db->select('name')->where('id', $id)->get('table')->result_array();   (or ->results()....or ->row()...or...read the docs for the possibilities :)  )

$q = the data in the result set, as an array
foreach($q as $row)
{
    echo $row['name'] . '<br />';
}
Its no different than straight php/mysql.


Messages In This Thread
Queery Model Action - by El Forum - 10-01-2010, 06:55 AM
Queery Model Action - by El Forum - 10-01-2010, 07:41 AM
Queery Model Action - by El Forum - 10-01-2010, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB