I got a variable:
var items = $('.ui-selected', this).map(function() {
return $(this).index();
}).get();
That's giving me an array of dynamic numbers. For example:
[0]
[0, 1]
So I want to pass that array to PHP. There I want to use these numbers to INSERT INTO
these specific columns. So when i get 0 and 1 in the array I want to write a value in column 1 and 2. To pass that value I tried this:
//JS
items = items.join(',')
$.post('/save.php', { 'items': items })
//PHP
$items = $_POST['items'];
$items = explode(',', $items);
But do MySQL columns got the same indexes as JS? So is the first column index 0?