I'm getting the above error when running the below code to display bookings made from a database.
$servername = "localhost";
$username = "*********";
$password = "********";
$dbname = "thelibr1_fyp";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, tablename, numseats, person FROM confirms";
$result = $conn->query($sql);
?>
Booking ID:
Table No.:
No. of Seats:
Person:
while(($row = $result->fetch_assoc()) !== null){
echo
"
{$row['id']}
{$row['tablename']}
{$row['numseats']}
{$row['person']}
\n";
}
?>
I only started to receive the error when i started hosting it live. It works fine on my personal computer, the databse connection works fine also.
No comments:
Post a Comment