I'm guessing that the problem is with the '' in the line
$query = "delete from discografi where $nummer = '$id'";
... and when $nummer refers to a numeric field the database is going "But that's a string value! Yuck!".
If $nummer always refers to numeric fields, then the line should probably be
$query = "delete from discografi where $nummer = $id";
But if it could be numeric or string, then some way of checking would be needed.
Let us know if dropping the '' helps.