query($sql) === TRUE) { header("Location: dashboard.php?msg=Application updated successfully"); exit(); } else { echo "Error updating record: " . $conn->error; } } else { header("Location: dashboard.php"); exit(); } ?>