I'm a newb, so thanks in advance for bearing with me. That being said, I'm trying to update a table in my database and failing. I received a few NULL responses, adjusted a few things, and most recently got a few 500 internal server errors, which typically seem to be related to invalid PHP... any help is greatly appreciated.
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($_POST['room']) {
$room_current = $conn->query('SELECT `Room_Availability` FROM Room_Status WHERE `Room_Name` = "'.$_POST['room'].'"');
if (!$room_current) {
die('ERROR: '.$conn->error);
}
$room_current = $room_current->fetch_assoc();
if ($room_current['Room_Availability'] == `OUT`); {
$room_set = $conn->query('UPDATE `Room_Status` SET `Room_Availability`= `IN` WHERE `Room_Name` = "'.$_POST['room'].'"');
if (!$room_set); {
die('ERROR: '.$conn->error);
}
}
var_dump($room_set);
?>