-3
<?php
    $con = mysqli_connect('localhost','root','','db') or die('Error connecting to MySQL server.');

    if(isset($_POST['rollNo'])){
        $rollNo = $_POST['rollNo'];

        $query = "Select * from table where ROLL_NUMBER LIKE '$rollNo'";
        $select = mysqli_query($con, $query);

        printf(mysqli_query($con));
        while ($row = mysqli_fetch_array($select)) {
            echo $row['FIRST_NAME'];
        }


    }
?>

It is showing the error that

mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ayush Bansal
  • 49
  • 2
  • 9

1 Answers1

-1

Use below code segment

    while($row = mysqli_fetch_assoc($result))
    {
        echo $row['FIRST_NAME'];
    }
Gaya
  • 32
  • 3