Untitled

 avatar
unknown
plain_text
a year ago
1.6 kB
5
Indexable
<?php
$servername = "localhost"; // assuming the MySQL server is on the same machine
$username = "your_username"; // replace with your MySQL username
$password = "your_password"; // replace with your MySQL password
$database = "IDK Cottage"; // replace with your database name

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

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

// Query to select data from the bookininfo table
$sql = "SELECT * FROM bookininfo";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // Output data of each row
    while($row = $result->fetch_assoc()) {
        echo "Customer Name: " . $row["customerName"]. "<br>";
        echo "Customer Address: " . $row["customerAdress"]. "<br>";
        echo "Passport/NID: " . $row["passport_NID"]. "<br>";
        echo "Customer Phone: " . $row["customerPhone"]. "<br>";
        echo "Customer Email: " . $row["customerEmail"]. "<br>";
        echo "Customer Gender: " . $row["customerGender"]. "<br>";
        echo "Customer Nationality: " . $row["customerNationality"]. "<br>";
        echo "Room Number: " . $row["roomNumber"]. "<br>";
        echo "Room Package: " . $row["roomPackage"]. "<br>";
        echo "Check-in Date: " . $row["checkinDate"]. "<br>";
        echo "Check-out Date: " . $row["checkoutDate"]. "<br>";
        echo "--------------------------------------<br>";
    }
} else {
    echo "0 results";
}
$conn->close();
?>
Editor is loading...
Leave a Comment