Welcome Guest, Not a member yet? Register   Sign In
Displaying menu based on num_rows
#5

[eluser]erik.brannstrom[/eluser]
The methods num_rows and result should both be used on the query object. Try the following.

Code:
// Replace this method in model:
function subnav($id){
  return $this->db->get_where('sub_content', array('section' => $id));
}

// In your view, set the foreach to this:
<?php foreach($query2->result() as $row) { ?>


Messages In This Thread
Displaying menu based on num_rows - by El Forum - 05-03-2010, 11:18 AM
Displaying menu based on num_rows - by El Forum - 05-03-2010, 11:30 AM
Displaying menu based on num_rows - by El Forum - 05-03-2010, 11:44 AM
Displaying menu based on num_rows - by El Forum - 05-03-2010, 12:16 PM
Displaying menu based on num_rows - by El Forum - 05-03-2010, 12:39 PM
Displaying menu based on num_rows - by El Forum - 05-03-2010, 02:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB