I designed a html form to to enter ID and submit and this is thecode:

<form action=”list.php” method=”post”>
ID student: <input type=”int”name=”id_student”><br>
<input type=”submit” value=”submit”><br/>
</form>

Then the file list.php should execute and show the courses thatthe student take. But I get errors when I execute it. What is theproblem with my code?

this is the code of list.php file:

<<?php  
$con = mysqli_connect(“localhost”,”root”,”Student_Database”);
  
if (mysqli_connect_errno())
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$sql=”SELECT * FROM course ORDER BY idcourse”;

if ($result=mysqli_query($con,$sql))
{
while ($row=mysqli_fetch_row($result))
{
printf ($row[1]);
}
mysqli_free_result($result);
}

mysqli_close($con);
?>