With jQuery I\'m retrieving positions of a sortable list using \'serialize\', like this:
var order = $(\'ul\').sortable(\'serialize\');
The vari
Lets say you were ordering news items, and your page sent this to "?id[]=2&id[]=3&id[]=1&id[]=4&id[]=5" your php code.
$_POST['id'] # would be [2,3,1,4,5]
// Now we need to update the position field of these items
foreach($_POST['id'] as $i=>$id ):
// For our first record, $i is 0, and $id is 2.
$post = Post::get($id); # Do you own database access here
$post->position = $i; # Set the position to its location in the array
$post->save(); # Save the record
endforeach