<?php 
include('connect.php');

if (isset($_POST['btn_action'])) {
   if ($_POST['btn_action'] == 'checkUsername') {
   	 $username = $_POST['user_name'];
   	 $sqlUsername = "SELECT * FROM tbl_admin WHERE username = '$username'";
   	 $resultUsername = $conn->query($sqlUsername);
   	 echo $resultUsername->num_rows;
   }

}

?>