<?php
	include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php");


	$sid=$_GET['sid'];
	
	$arr = array();
	$i = 0;
	
	$result = $conn->query("SELECT * FROM user_account WHERE accountType = 2 AND school_id = '".$sid."'");
		
		if($result) {
			$tIndex = 0;

			while ( $row = $result->fetch_assoc() ){
				$tIndex++;

				$arr[$i] = array('tIndex' => $tIndex, 'tID' => $row['user_id'], 'tName' => $row['username']);
				$i++;
			}
		}

	$conn->close();

	echo json_encode($arr);
	// echo 1;
?>