You can just do it as
$query = "SELECT `stud_no` FROM " . $mysql_tb . " WHERE `stud_no`='$studno'";
but I would recommend looking into PDO ( http://www.php.net/manual/en/book.pdo.php && http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/).