Posting to database

I’ve found this drag and drop script and it’s brilliant but I can’t seem to get it to update the results in the database.

I’ve got this on the page:

<script language="Javascript">
	$(document).ready(function() {
			 // Initialise the table
				onDragClass: "drag",
				onDrop: function(table, row) {	
					 type: "POST",
					 url: "http:/",
					 data: "" + $.tableDnD.serialize(),
					 success: function(html){


the alert box does give the correct values, but when I call the ajaxtest.php page nothing happens.
The ajaxtest.php page has this:

include '../includes/db.php';
$images[] = $_POST['images'];
		$i = 0;
			foreach($images as $value) {
				foreach($value as $row){
					if($row != 'tHeader'){
						$this-&gt;Image-&gt;set('id', $row);
						$this-&gt;Image-&gt;set('order', $i);
$con = mysql_connect($host,$username,$password);
if (!$con)
  die('Could not connect: ' . mysql_error());
mysql_select_db($database, $con);
$sql= sprintf("UPDATE `images` SET `order`='$i' WHERE `id`='$row'");
if (!mysql_query($sql,$con))

I’m pretty sure the problem is with the $images[] = $_POST[‘images’]; but of code, but I’m not sure exactly where and would be extremely grateful for any help.

If you’re uploading any files to a database, they get sent by the $_FILES array. Be sure to sanitize them when uploading, eg is the file size within the range allowed, is the image size in the range allowed, etc

It’s not the actual files that are being uploaded just the order they’re displayed in. Each image as an order field and that’s all I’m trying to do is update that.