<?
require_once('user.php');
require_once('mysql.php');
require_once('functions.php');

// SETUP MYSQL HANDLERS
$mysqldb1 = new mysql($host, $user, $pswd, $db);
$mysqldb1->connect();
$mysqldb1->select();

// UPDATE SEQUENCE
foreach ($_POST['item'] as $position => $item) {
    $query = "UPDATE ".$_POST['table']." SET sequence=".$position." WHERE id=".$item;
    $mysqldb1->query($query);
}
?>
<?
$mysqldb1->close();
?>