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

(This post was last modified: 07-28-2020, 04:50 PM by richb201.)

I am trying to update a field in all of the record showing with this:

$this->db->where('email', $_SESSION['userid']);
$this->db->where('campaign', $_SESSION['campaign']);
$data[] = array(
    'in_sample' => 0
);
$this->db->update_batch('employees', $data);


The where()'s are used to make sure that I only update this user's data since this is a multi-user system. When I run the update_batch() line I get this error. In sample is an int btw. 

A Database Error Occurred
You must specify an index to match on for batch updates.

Filename: models/MyModel.php
Line Number: 143



I have set in_sample to be indexed in the database.
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



Theme © iAndrew 2016 - Forum software by © MyBB