You do not need to create a separate array for this. You can pass $_POST['std_id]
that has an id
s array .
controller
$this->modelname->mymethod($_POST['std_id'],$updateData);
where $_POST['std_id']
is an array of identifiers and $updateData
for updating fields
model
function mymethod($idArr,$data){
$this->db->where_in("fieldname", $idArr);
$this->db->update("tablename",$data);
}
you can use where_in
for mysql IN
to check multiple ids.
source
share