Use the DB increment function to update from an array

Asked

Viewed 25 times

0

Here’s what it is: I have a javascript array with the id I want to increment usingDB::table('team').increment->('points', 1000). How should I make my controller take this array and increment only the id on it?

  • you are sending how? if you have javascript code?

  • That’s it. In the script I write in an array and I can send it to an Hidden input by separating each id by commas. But I have no idea how to send this to my controller. I created a score() function but could not implement it to receive this data

  • Put the script you save the array to?

  • var id = $(this).attr('id');
 var selected = id.charAt(id.length-5);
 var team = id.charAt(id.length-3);
 var order = id.charAt(id.length-1);
 selections[order] = [parseInt(team),parseInt(selected),id];

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.