while running the Php script it shows error-ThrowExceptions

Exception or error:
<?php

    include 'conn.php';
    $name = $_POST['Name'];
    $password = $_POST['password'];

    $queryResult=$connect->query("SELECT * FROM test WHERE Name='$name'");

    $result=array();

    while($fetchData=$queryResult->fetch_assoc()) {
        $result []=$fetchData;
    }
    echo json_encode($result);


?>

The above code shows the error:

Notice: Undefined index

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *