Need Php mysql query help


I want to get error if wrong Admission no is entered.
I’m not able to find a way Plz help me.

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 :slight_smile:


@ckhawand I’m not able to figure it out can you fix and paste it for me here

    //Connect to dataBase
        $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


@ckhawand Gotcha issue fixed.
Thank you so much.

closed #9