I want to get error if wrong Admission no is entered.
I’m not able to find a way Plz help me.
https://pastebin.com/dSSL7UP1
Thanks in advance.
I want to get error if wrong Admission no is entered.
I’m not able to find a way Plz help me.
https://pastebin.com/dSSL7UP1
Thanks in advance.
Then you would do
if($row['adm_no'] == $_POST['search']){
// execute some code
}
You could also do
if(mysqli_num_rows($resultSet) != 0){
//do some code
}
Should i add this at the end?
After the fetching command
<?php
include_once("bg.php");
ob_start();
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
//Connect to dataBase
$mysqli=mysqli_connect("localhost","root","","test");
$search = $mysqli->real_escape_string($_POST['search']);
//query the Database
$resultSet = $mysqli->query("SELECT * FROM stud_adm WHERE adm_no = '$search'");
$row= mysqli_fetch_array($resultSet);
if(mysqli_num_rows($resultSet) != 0){
//do some code
}
}
?>