<?php
// Your database connection details
$servername = "localhost";
$username = "hayatmus_muslim";
$password = "hayatmusmuslim";
$dbname = "hayatmus_homepage";

// Create a connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check the connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Fetch all customer feedback
$fetchQuery = "SELECT * FROM feedback ORDER BY id DESC";
$result = $conn->query($fetchQuery);

if ($result->num_rows > 0) {
    // Start building HTML content
    $html = '<ul>'; // Start unordered list
    while ($row = $result->fetch_assoc()) {
        // Add list item for each feedback entry
        $html .= '<li>';
        $html .= 'Name: ' . $row['name'] . ', Email: ' . $row['email'] . ', Comments: ' . $row['comments'];
        $html .= '</li>';
    }
    $html .= '</ul>'; // Close unordered list
    echo $html; // Output HTML
} else {
    echo "No feedback found";
}

// Close the database connection
$conn->close();
?>
