But if a record is deleted, lets say record "5" I have a problem reordering from 4 to 6... Here is my script...
Code: Select all
if ($direction == "down") {
$result = $db->sql_query("UPDATE ".$prefix."_links SET order_no = (order_no - 1) WHERE uid = $uid AND catid = '$catid' AND order_no = ($order + 1)");
$result = $db->sql_query("UPDATE ".$prefix."_links SET order_no = (order_no + 1) WHERE uid = $uid AND linkid = '$linkid'");