Hello Guys,
During the process of making my website I have been stopped by a problem.
Background Info: I am using jQuery sortable lists and I have multiple lists on the site which submit the information to the file that updates them in the database.
Problem: If I want to move one item to another list, I need to change one field in a MySQL table to correspond with the name of the UL.
This is my file that submits the information to the database:
<?php
session_start();
include('config.php');
parse_str($_POST['containersTop'], $containersTopPos);
foreach ($containersTopPos['page'] as $moduleOrderTop => $moduleIdTop) {
mysql_query("UPDATE modules SET `order` = '$moduleOrderTop' WHERE `id` = '$moduleIdTop' ") or die(mysql_error());
}
parse_str($_POST['containersMain'], $containersMainPos);
foreach ($containersMainPos['page'] as $moduleOrderMain => $moduleIdMain) {
mysql_query("UPDATE modules SET `order` = '$moduleOrderMain' WHERE `id` = '$moduleIdMain' ") or die(mysql_error());
}
?>
Now, If I move an item from the list main to the list top, the section field in the MySQL table needs to be changed to top and vice versa.
What should I add for it to work like that?
Thanks,
Oskar