Welcome Guest, Not a member yet? Register   Sign In
Problems with where_not_in
#2

[eluser]xwero[/eluser]
get returns the query object not the actual result. The where_not_in expects an array as second parameter so the code changes are
Code:
$assigned_genres = $this->db->get();
// becomes
$query = $this->db->get();
$rows = $query->result();
$ids = array();
foreach($rows as $row)
{
   $ids[] = $row->genre_id
}
/* and */
$this->db->where_not_in('genre_id', $assigned_genres);
// becomes
$this->db->where_not_in('genre_id', $ids);


Messages In This Thread
Problems with where_not_in - by El Forum - 04-28-2009, 07:01 AM
Problems with where_not_in - by El Forum - 04-28-2009, 07:29 AM
Problems with where_not_in - by El Forum - 04-28-2009, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB