prepare("UPDATE transactions SET status = :status WHERE transaction_id = :transaction_id"); $stmt->bindParam(':transaction_id', $transaction_id, PDO::PARAM_STR); $stmt->bindParam(':status', $status, PDO::PARAM_STR); $stmt->execute(); // Validasi apakah update berhasil if ($stmt->rowCount() === 0) { http_response_code(404); // Not Found echo "Transaction not found."; exit; } // Response sukses http_response_code(200); // OK echo "Transaction status updated."; } catch (PDOException $e) { // Tangani kesalahan database http_response_code(500); // Internal Server Error echo "Database error: " . htmlspecialchars($e->getMessage()); exit; } ?>