I have this follow system that lets you follow certain type of statuses. When you follow someone, it puts your user id into the friends table along with the friend's id. Lastly, it adds in what type of statuses you want to follow. So say a user wants to follow just my statuses and not photos, the type would = 1 for statuses. The statuses table has the type in it too, so this query works just fine for that, but I want it to select all status types if the type is equal to zero, so how would I do that?
$this->db->select('statuses.type,statuses.text,statuses.media_url,statuses.user_id,statuses.id,users.name,users.username,users.avatar');
$this->db->from('statuses');
$this->db->join('friends', 'friends.type = statuses.type AND friends.friend_id = statuses.user_id OR friends.user_id = statuses.user_id');
$this->db->join('users', 'users.id = statuses.user_id');
$this->db->where('friends.user_id', $user_id);
$this->db->where('friends.confirmed', 1);
friends.type, when equal to 1, would select statuses types = to 1 in the status table. This would work if the type = 2 or 3 for the other types of statuses, like photos or videos. Like I said, I just need a way to select all status types if the friends.type = 0.