<?php
// Database connection details
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "clients"; // Replace with your actual database name

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

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

// SQL query to select all records from the 'client' table
$sql = "SELECT Id_Client, Nom_Client, Age_Client, Adr_Client FROM client";
$result = $conn->query($sql);

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Display Clients</title>
</head>

<body>
    <h2>Client Records</h2>
    <?php
    if ($result->num_rows > 0) {
            while ($row = $result->fetch_assoc()) {
            echo $row["Id_Client"];
            echo $row["Nom_Client"];
                    }
            } else {
        echo "No records found";
    }

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

</html>