There are posts here already for this issue but I still don't get the database to update. Ajax sends me a 200 OK but as said no db update: (the $platform->id is not the issue, foreach is set). Thank you for help!
Jquery
$('#button_<?php echo $platform->id; ?>').click(function(event) {
event.preventDefault();
var platform_id = <?php echo $platform->id; ?>;
$.ajax({
type: "POST",
url: "<?php echo site_url('home/select_job'); ?>",
data: {id : platform_id},
success: function(){ alert("success"); },
});
Controller
$platform_id = $this->input->post('platform_id');
$user_id = $this->session->userdata('id');
$this->users_model->job_selection($user_id, $platform_id);
Model
public function job_selection($user_id, $platform_id){
$this->db->set('user_id', $user_id);
$this->db->set('status', 2);
$this->db->set('select_company', 1);
$this->db->where('id', $platform_id);
$this->db->update('companies');
}