Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] How many rows does a query return?
#4

[eluser]Twisted1919[/eluser]
Code:
function obtener_todos()
{
   $query = $this->db->get('Mytable');
   return ($query->num_rows() > 0 ) ? $query->result() : FALSE ;
}
Code:
$array = $this->model->obtener_todos();

if( $array != FALSE && count($array) > 0 )
{
for($i=0;$i<=$array;++$i)
   {
   //do the magic here ....
   }
}


Messages In This Thread
[SOLVED] How many rows does a query return? - by El Forum - 01-14-2010, 06:22 PM
[SOLVED] How many rows does a query return? - by El Forum - 01-14-2010, 06:32 PM
[SOLVED] How many rows does a query return? - by El Forum - 01-14-2010, 06:40 PM
[SOLVED] How many rows does a query return? - by El Forum - 01-14-2010, 07:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB