您必须使用 "set" 方法更新发生数据库错误
You must use the "set" method to update A Database Error Occurred
您必须使用“设置”方法来更新一个entry.Filename:modules/unfollow/controllers/unfollow.php行号:251
// save logs
$this->db->insert($this->tb_logs, $logs);
updateLogsCounter('data_logs',$item->type,'up', $this->tb_accounts, $item->account_id);
updateLogsCounter('data',$item->type.'_tmp','up', $this->tb_schedule, $item->id);
// set time for next schedule
$data_update['status'] = 5;
$data_update['result'] = 'Successfully';
$rand_time = rand(5,30);
$data_update['time_post'] = date('Y-m-d H:i:s', strtotime(NOW) + $item->delay + $rand_time);
}
$this->db->where("ids", $item->ids);
**LINE 251-->>>** $this->db->update($this->tb_schedule, $data_update);
}
}
}
您的查询应该可以正常工作,因为您可以将数据作为第二个参数传递给 update() 但尝试
改变这个
$this->db->where("ids", $item->ids);
$this->db->update($this->tb_schedule, $data_update);
到
$this->db->set($data_update)->where("ids", $item->ids);
$this->db->update($this->tb_schedule);
并完成 documentation
您必须使用“设置”方法来更新一个entry.Filename:modules/unfollow/controllers/unfollow.php行号:251
// save logs
$this->db->insert($this->tb_logs, $logs);
updateLogsCounter('data_logs',$item->type,'up', $this->tb_accounts, $item->account_id);
updateLogsCounter('data',$item->type.'_tmp','up', $this->tb_schedule, $item->id);
// set time for next schedule
$data_update['status'] = 5;
$data_update['result'] = 'Successfully';
$rand_time = rand(5,30);
$data_update['time_post'] = date('Y-m-d H:i:s', strtotime(NOW) + $item->delay + $rand_time);
}
$this->db->where("ids", $item->ids);
**LINE 251-->>>** $this->db->update($this->tb_schedule, $data_update);
}
}
}
您的查询应该可以正常工作,因为您可以将数据作为第二个参数传递给 update() 但尝试
改变这个
$this->db->where("ids", $item->ids);
$this->db->update($this->tb_schedule, $data_update);
到
$this->db->set($data_update)->where("ids", $item->ids);
$this->db->update($this->tb_schedule);
并完成 documentation