Please, I'm have problem with this. I'm trying to insert into a table allocate and update a table rooms. So that every room occupied will not show on the dropdown menu. Thanks
if (isset($_POST['submit'])) { $queryA = "INSERT INTO allocate(surname, firstname, regno, gender, dept, year, hostel, rooms) VALUES('".$_SESSION['surname']."','".$_SESSION['firstname']."','".$_SESSION['regno']."','".$_SESSION['gender']."', '".$_SESSION['dept']."', '".$_SESSION['year']."', '".$_SESSION['hostel']."', '".$_POST['rooms']."') "; /*"SELECT * FROM rooms". "WHERE name ='".$_POST['rooms']."'";*/ $resultA = mysql_query($queryA) or die(mysql_error()); if ($resultA) { $occupied = 'occupied'; $queryA1 ="UPDATE rooms". "SET status = '".$occupied."'" . "WHERE name = '".$_POST['rooms']."'"; $resultA1 = mysql_query($queryA1) or die (mysql_error()); } }