Welcome Guest, Not a member yet? Register   Sign In
trying to use batch_update()
#11

Here it looks like you wrote a SELECT query, did not utilize the result, and then wrote a separate UPDATE query with no conditions.

I think you're wanting to do something like this..

PHP Code:
$this->db
    
->set(['in_population' => 1])
    ->
where('email'$_SESSION['userid'])
    ->
where('campaign'$_SESSION['campaign'])
    ->
group_start()
        ->where('employee_title',  $exclude_string)
        ->or_where('job_code',  $exclude_string)
        ->or_where('department',  $exclude_string)
        ->or_where('role',  $exclude_string)
    ->
group_end()
    ->
update('employees'); 
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



Theme © iAndrew 2016 - Forum software by © MyBB