query($sql)) { echo "Successfully deleted $type."; } else { echo "Error deleting record: " . $conn->lastErrorMsg(); } echo $conn->lastErrorMsg(); } else { echo 'Something went wrong! (No type or no UID provided.)'; } ?>