<?php
include("connect.php");
include("connectp.php");

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $collegecode = $_POST['collegecode'];
    /* $email = 'at.zeelsheth@gmail.com'; */
    
    // Perform a database query to check if the email exists
    $query = "SELECT COUNT(*) AS count FROM res_college_master WHERE collegecode = :collegecode";
    $stmt = $db7->prepare($query);
    $stmt->bindParam(':collegecode', $collegecode);
    $stmt->execute();
    $result = $stmt->fetch();
    $count = $result['count'];
    
    if ($count > 0) {
        echo 'exists';
    } else {
        echo 'unique';
    }
}
?>
