[jQuery] Jquery, AJAX and MySQL update

[jQuery] Jquery, AJAX and MySQL update


Hi, I hope someone can help me with this. I've been reading jquery.com
tutorials and others online to try and create a sortable drag and drop
list which updates a mysql table using AJAX. After a few hours of head
scratching I finally got most of it, but I'm stuck on the bit that
passes the serialised data via AJAX to the script. Here is the script.
<script>
$(document).ready(function(){
$("#list").sortable({
accept: 'item',
update: function(sorted) {
serial = $('#list').sortable('serialize');
$.ajax({
url:"updatesql.php",
type:"POST",
data: serial.hash,
error:function(){alert('Failed');},
success:function(){alert('Success');}
});
}
});
});
</script>
If I replace the line "data: serial.hash" with "data:
name=John&location=Boston" as in the jquery.com example then my
"updatesql.php" file will run - obviously without the correct data. So
I'm guessing that's the offending line. Can someone see an obvious
problem? I can post the full HTML/PHP code if required although this is
the offending bit.
I'm using jquery-1.2.4a.js, ui.base.min.js, ui.draggable.min.js,
ui.droppable.min.js, ui.sortable.min.js.
Hope someone can help,
Thanks in advance,
Chris.