[php][MySQL]Record delete and position update

Hey, I have problem with update the position of record in DB. Delete from DB is going fine, but not the update querry... I'm polish, so few names in my code are in polish, but I think in general you will understand.
usun_a.php