<?php 

function connect(){
$dbc = mysqli_connect("localhost", "sshuujin_bowenapp", "80622BOWen") or die('No server');
	mysqli_select_db($dbc, "sshuujin_bowensshub_v2") or die('No db');
	return $dbc;

}

$dbc = connect();
$id= $_POST['id'];

$query = "SELECT * FROM departments WHERE Faculty_FacultyCode1 = '$id'";
$run = mysqli_query($dbc, $query);
$list = array();
while($row = mysqli_fetch_row($run)){
	$temp = array();
	array_push($temp, $row[0], $row[1]);
	array_push($list, $temp);
	
}
$list = json_encode($list);
echo $list;


?>