<?php

/*Student API*/


/*Fetching API*/


/* Attempt to connect to MySQL database */
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'Restax_final');

define('DB_PASSWORD', 'Restax_final123');

define('DB_NAME', 'Restax_api_data'); 

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$response=array();



/////get room number block id number/////

$sql_seat="SELECT * FROM seatingarrangements WHERE date = '2019-12-12'";

$result_seat=mysqli_query($con,$sql_seat);

    while ($row_seat[]=mysqli_fetch_assoc($result_seat)) {  


$user_seat = $row_seat;


}

///put student thier rexpective rooms../////



//echo print_r($user_seat[0]['time']);



 echo json_encode($user_seat);


?>