mardi 28 août 2018

How to put the values from database to a specific row in the table

Here is the code for the fetching of the data from the database

<?php

                                      $uid  = $_SESSION['UID'];
                                      $result = mysqli_query($conn,"SELECT user.*,score.* from `user` join score ON user.USERID=score.USERID WHERE user.USERID=$uid ");

                                      if (!$result) {
                                          printf("Error: %s\n", mysqli_error($conn));
                                          exit();
                                      }
                                    while($row = mysqli_fetch_array($result))
                                    {
                                      echo "<tr>";
                                      echo "<td>".$row['SCORE']."</td>";
                                      echo "<td>".$row['AVERAGE']."</td>";
                                      echo "<td>".$row['POINTS']."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                    }
                                     echo "</tr>";
                              ?>

Here is the database where i want for each actcode it will go to a certain row of the table of the output

Here is the current output where im getting all of the data from the database in the Lesson Exam Row. My desired output should be for example the actcode - number 1 should be in the lesson exam row, number 2 is for module 1, number 3 for module 2 and so on

Thank you in advance for your help.




Aucun commentaire:

Enregistrer un commentaire