= 1) { $row = $res->fetch_assoc(); mysqli_query($conn, "UPDATE orders SET status = 'x' WHERE id={$_POST['order_id']}"); $email = mysqli_query($conn, "SELECT email FROM users WHERE user_id={$row['user_id']}")->fetch_assoc()['email']; SendMail($email, "InnovaDB Update\n", "Your order with id({$row['id']}) has been DISCARDED\n"); } header("Location: ./PendingOrders.php"); die(); ?>