<?php
include '../../db_connect.php';

$id = $_GET['id'];
$sql = "SELECT * FROM questionans WHERE id = $id";
$result = $conn->query($sql);
$question = $result->fetch_assoc();
?>

<?php
include "../layout/header.php";
?>
    <div class="container mt-5">
        <h2 class="text-center">Question Details</h2>
        <div class="card">
            <div class="card-body">
                <h5 class="card-title"><?= $question['name'] ?></h5>
                <p class="card-text"><strong>Email:</strong> <?= $question['email'] ?></p>
                <p class="card-text"><strong>Phone:</strong> <?= $question['phone'] ?></p>
                <p class="card-text"><strong>Subject:</strong> <?= $question['subject'] ?></p>
                <p class="card-text"><strong>Message:</strong> <?= $question['message'] ?></p>
                <a href="index.php" class="btn btn-primary">Back to List</a>
            </div>
        </div>
    </div>
</body>
</html>

<?php $conn->close(); ?>
