Welcome Guest, Not a member yet? Register   Sign In
Chained Select with Form Generation Library
#2

[eluser]toopay[/eluser]
The PHP error tell you that you have an non-array type in your foreach() (in your view file). If you're supply foreach argument directly from your database, make sure you had the right output on your model(or place some data validation properly on your view file, before put it on foreach statement)!
This is an example of common pitfall:
Code:
function some_sql()
{
   $query = $this->db->get('foo');
   // This will generates error when the database returned 0 result, if you didnt place some data validation properly on your view file.
   if(count($query->result_array()) > 0)
   {
      return $query->result_array();
   }
}


Messages In This Thread
Chained Select with Form Generation Library - by El Forum - 04-22-2011, 10:21 AM
Chained Select with Form Generation Library - by El Forum - 04-23-2011, 12:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB