Course Solutions Uncategorized (Solved) : Designed Html Form Enter Id Submit Code Id Student File Listphp Execute Show Courses Stude Q34204480 . . . .

(Solved) : Designed Html Form Enter Id Submit Code Id Student File Listphp Execute Show Courses Stude Q34204480 . . . .

 

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);
?>

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

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

Related Post