0
How do I query my sql database to give me a dynamic table
I have a database filled with student registration number, course, score, grade, and point . I need a sql statement that select this result and match courses, score and grade to each student. I try using the below code it duplicating student registration number and course instead of a distinct selection
2 Answers
0
It is not yet clear. What is the result you want to see and what is the query that you have wrote?
0
<table>
<thead>
<tr>
<th>Registration Number </th>
<th>course </th>
<th>Total score </th>
<th>Grade </th>
<tr>
<thead>
<tbody>
<tr>
<?php
$con=mysqli_connect('localhost','root','' 'result' );
If(!$con){
echo "not connected"
}
$sql="SELECT*FROM test ";
$result=msqli_query($con,$sql);
while($row=mysqli_fetch_array($result)){
?>
<td><?php echo $row['reg'];?></td>
<td><?php echo $row['course'];?></td>
<td><?php echo $row['total'];?></td>
<td><?php echo $row['grade'];?></td>
<tr>
<?php
}
?>
</tbody>
I want something like this result picture https://drive.google.com/file/d/1ygvGBBqhigCgKrghYQ0i4fWRdgMJV8pS/view?usp=drivesdk
Not repeated names and courses can you help?