permission_level = $level; $permissions->custom_permissions = json_decode($custom); $permissionString = json_encode($permissions); if ($conn->query("UPDATE Users SET Permissions='$permissionString' WHERE UID='$uid'")) { echo "Successfully updated permissions."; } else { echo "Error updating database: " . $conn->lastErrorMsg(); } ?>