CodeIgniter Forums

Full Version: trying to use batch_update()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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'); 
Works great! thank you.
Pages: 1 2