I have been trying to redirect after inserting into the database but it's not working. The insert is working perfectly but it's not redirecting here is my code
if (count($errors) == 0) {
$query = "INSERT INTO investment (userid, amount, status, hashID, plan)
VALUES('$uidb', '$amount', '$status', '$id', '$plan')";
$results = mysqli_query($db, $query);
if (mysqli_num_rows($results) == 1) {
exit(header('location: https://google.com'));
}else {
array_push($errors, "Invalid Sort Code");
}
}