<?php
include("../includes/db_connection.php");

if(isset($_POST['email'])){

    $email = trim($_POST['email']);

    $stmt = $conn->prepare("SELECT id FROM associates WHERE email=?");
    $stmt->bind_param("s", $email);
    $stmt->execute();
    $stmt->store_result();

    if($stmt->num_rows > 0){
        echo "exists";
    } else {
        echo "available";
    }

    $stmt->close();
}
?>