Welcome Guest, Not a member yet? Register   Sign In
Passing a single array to a model
#6

[eluser]xwero[/eluser]
why not use the parameters like some of the CI functions do
Code:
function get($field, $val='')
{
   if(is_string($field) && strlen($val)>0)
   {
      $field = array($field=>$val);
   }

   if( ! is_array($field))
   {
      return array();
   }

   $this->db->where($field);
   $query = $this->db_>get('table');

   return $query->result();
}


Messages In This Thread
Passing a single array to a model - by El Forum - 03-08-2009, 12:40 PM
Passing a single array to a model - by El Forum - 03-10-2009, 06:59 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:18 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:30 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:35 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:37 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:43 AM
Passing a single array to a model - by El Forum - 03-10-2009, 07:48 AM
Passing a single array to a model - by El Forum - 03-10-2009, 08:36 AM
Passing a single array to a model - by El Forum - 03-10-2009, 08:50 AM
Passing a single array to a model - by El Forum - 03-10-2009, 08:55 AM
Passing a single array to a model - by El Forum - 03-10-2009, 09:13 AM
Passing a single array to a model - by El Forum - 03-10-2009, 09:47 AM
Passing a single array to a model - by El Forum - 03-10-2009, 09:53 AM
Passing a single array to a model - by El Forum - 03-10-2009, 10:35 AM
Passing a single array to a model - by El Forum - 03-10-2009, 10:53 AM
Passing a single array to a model - by El Forum - 03-10-2009, 11:23 AM
Passing a single array to a model - by El Forum - 03-10-2009, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB