
Vielen, vielen Dank an combie und selbstverständlich auch an alle Anderen!

Nichts ändern, einfach nur verwenden. 
*looool*
Nichts ändern, einfach nur verwenden.
Daher ist der Thread leider noch aktuell...
Das ist alles gar nicht so schwer.....
//// Sorting DOWN; Means that the actual item changes priority with the following one...
$step1 = "UPDATE site_bloxx SET priority = ".$this_blx['priority']." WHERE priority > ".$this_blx['priority']." AND group_id = ".$this_blx['group_id']." LIMIT 1";
mysql_query($step1) or header("Location: index.php?notice=err&fwddata=back");
$step2 = "UPDATE site_bloxx SET priority = ".($this_blx['priority'] + 1)." WHERE id = ".$this_blx['id']." AND group_id = ".$this_blx['group_id']." LIMIT 1";
mysql_query($step2) or header("Location: index.php?notice=err&fwddata=back");
//// Sorting UP; Means that the actual item changes priority with the previous one...
$step1 = "UPDATE site_bloxx SET priority = ".$this_blx['priority']." WHERE priority < ".$this_blx['priority']." AND group_id = ".$this_blx['group_id']." LIMIT 1";
mysql_query($step1) or header("Location: index.php?notice=err&fwddata=back");
$step2 = "UPDATE site_bloxx SET priority = ".($this_blx['priority'] - 1)." WHERE id = ".$this_blx['id']." AND group_id = ".$this_blx['group_id']." LIMIT 1";
mysql_query($step2) or header("Location: index.php?notice=err&fwddata=back");
UPDATE tabelle
SET priority = $x + $y - priority
WHERE priority IN ($x, $y)
UPDATE tabelle
SET priority = $x + $y - priority
WHERE priority IN ($x, $y)
Einen Kommentar schreiben: