• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to use batch_update()

#9
I switched it over to:
            $data = array(
                'in_population' => 1
            );
            $this->db->where('email', $_SESSION['userid']);
            $this->db->where('campaign', $_SESSION['campaign']);
            $this->db->or_where('employee_title', $exclude_string);
            $this->db->or_where('job_code', $exclude_string);
            $this->db->or_where('department', $exclude_string);
            $this->db->or_where('role', $exclude_string);
            $this->db->update('employees',$data );

I am hoping this means that if the email matches and the campaign matches, then if my exclude string appear in employee_title, job_code, department, or role, then update in_population to 1. (this means they are NOT in the population, btw).  Is there someway to see how many updates were done? This is currently not updating any. Is there something wrong with my logic?

I saw a post where "where_in" is being used to check a few results in a single field. I am doing the opposite. I have one string that I want to see if it appears in any of 4 fields. I expected that if one of those fields matched my exclude_string, "in_population" would get set to 1. But this doesn't seems to update any of the rows. I am sure that some of those rows should be updated. I expected that the first two where's are being ANDed with the 4 or_wheres? Is this a correct assumption?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
trying to use batch_update() - by richb201 - 07-28-2020, 04:49 PM
RE: trying to use batch_update() - by ojmichael - 07-28-2020, 08:58 PM
RE: trying to use batch_update() - by qury - 07-29-2020, 01:22 AM
RE: trying to use batch_update() - by richb201 - 07-29-2020, 08:32 AM
RE: trying to use batch_update() - by richb201 - 07-29-2020, 11:16 AM
RE: trying to use batch_update() - by richb201 - 07-29-2020, 02:52 PM
RE: trying to use batch_update() - by richb201 - 07-30-2020, 09:19 AM
RE: trying to use batch_update() - by ojmichael - 07-30-2020, 04:17 PM
RE: trying to use batch_update() - by richb201 - 08-01-2020, 09:02 AM
RE: trying to use batch_update() - by richb201 - 08-02-2020, 05:23 PM
RE: trying to use batch_update() - by ojmichael - 08-03-2020, 05:55 PM
RE: trying to use batch_update() - by richb201 - 08-03-2020, 06:06 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.