<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$admin = $_SESSION["admin_" . $dbname];
if(isset($_REQUEST['subj'])){

$subj   = $_REQUEST['subj'];

$query = "SELECT  `code`, `name` FROM `subject` WHERE `name`='$subj'";

$result = mysqli_query($conn, $query)or die(mysqli_error($conn));
$r = mysqli_fetch_assoc($result);
$subcode = $r[code];
echo $subcode;
}



