DIe Lösung :
Leute vergesst nicht die Eingaben zu validieren/abzusichern !
public function moveEntry(){
$max = query("SELECT COUNT(*) FROM webcodes WHERE domain ='".$_GET['domain_id']."'");
if ( ( $_GET['move'] == 'up' ) && ( $_GET['position'] > 0 ) ) {
$moving_operator = '-';
}
if ( ( $_GET['move'] == 'down' ) && ( $_GET['position'] < $max ) ) {
$moving_operator = '+';
}
query("UPDATE tabelle SET sort = ( $_GET['position'] ) WHERE sort = ( $_GET['position'] $moving_operator 1 )");
query("UPDATE tabelle SET sort = ( $_GET['position'] $moving_operator 1 ) WHERE eintrag = '$_GET['id']'");
header('Location : selbeseite.php');
}
Auf Basis des Beispiels change.sort.php