prepare('UPDATE visits SET status = :status WHERE id = :id'); $stmt->bindParam(':status', $status, PDO::PARAM_STR); $stmt->bindParam(':id', $visit_id, PDO::PARAM_INT); $stmt->execute(); } catch (PDOException $e) { // Optional: Log error to a file // error_log('Database error: ' . $e->getMessage()); } } } // Redirect back to the review page header('Location: view_visits.php'); exit;