I have this problem where I am trying to get input from the user and then display information. The user is meant to insert an ID number, obtained by $_POST[PID]
, then I catch that in result and when I try to get the result and print their info. This is the code:
$result = mysqli_query($connection, $_POST[PID]);
while($row = mysqli_fetch_array($result))
{
echo some info
echo "<br>";
}
However such code yields this error:
mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
How can I fix such error such that I am able to obtain the input and use it in mysqli_fetch_array