SHARE
TWEET

Untitled

a guest Jun 25th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while ($res = $result->fetch_assoc()) {
  2.         echo "<tr><td>" . $res['subname'] . "</td>";
  3.  
  4.         $result2 = mysqli_query($mysqli, "SELECT *
  5.                                             FROM grades
  6.                                             JOIN gradesets ON grades.gradeset_id = gradesets.id
  7.                                             WHERE grades.student_id = {$row['id']}
  8.                                             AND grades.subject_id = {$res['id']}
  9.                                             ORDER BY grades.gradeset_id ") or die($mysqli->error);
  10.  
  11.         while ($res2 = $result2->fetch_assoc()) {
  12.  
  13.             echo "<td>" . $res2['grade'] . "</td>";
  14.             //echo "<td>" . $res2['gradeset_id'] . "</td>";
  15.             //print_r($res2);
  16.             $resset = $res2['gradeset'];
  17.             $resset2 = substr($resset, -1);
  18.             //print_r($resset);
  19.             //print_r($resset2);
  20.  
  21.         }
  22.     }
  23.      
  24. $student = $mysqli->query("SELECT * FROM student");
  25.  
  26. echo "<center>";
  27. echo "<h2>Data Wall</h2>";
  28. echo "<h3>PHP</h3>";
  29. echo "<hr/>";
  30.  
  31. while ($row = $student->fetch_assoc()) {
  32.     echo "<table border='1'>
  33.             <tr>
  34.                 <th>ID</th>
  35.                 <th>STUDENT</th>
  36.                 <th>HOUSE</th>
  37.             </tr><br>";
  38.     echo "<tr>";
  39.     echo "<td>" . $row['id'] . "</td>";
  40.     echo "<td>" . $row['stuname'] . "</td>";
  41.     echo "<td>" . $row['house'] . "</td>";
  42.     echo "</tr><br><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>";
  43.     echo "<tr><th>SUBJECTS</th><th>PC1</th><th>PC2</th><th>PC3</th><th>PC4</th></tr>";
  44.     $result = mysqli_query($mysqli, "SELECT  subjects.id,subjects.subname
  45.                                     FROM student
  46.                                     JOIN grades ON student.id = grades.student_id
  47.                                     JOIN subjects ON subjects.id = grades.subject_id
  48.                                     WHERE student.id = {$row['id']}
  49.                                     GROUP BY subjects.subname ORDER BY subjects.id ") or die($mysqli->error);
  50.  
  51.     while ($res = $result->fetch_assoc()) {
  52.         echo "<tr><td>" . $res['subname'] . "</td>";
  53.  
  54.         $result2 = mysqli_query($mysqli, "SELECT *
  55.                                             FROM grades
  56.                                             JOIN gradesets ON grades.gradeset_id = gradesets.id
  57.                                             WHERE grades.student_id = {$row['id']}
  58.                                             AND grades.subject_id = {$res['id']}
  59.                                             ORDER BY grades.gradeset_id ") or die($mysqli->error);
  60.  
  61.         while ($res2 = $result2->fetch_assoc()) {
  62.  
  63.             echo "<td>" . $res2['grade'] . "</td>";
  64.             //echo "<td>" . $res2['gradeset_id'] . "</td>";
  65.             //print_r($res2);
  66.             $resset = $res2['gradeset'];
  67.             $resset2 = substr($resset, -1);
  68.             //print_r($resset);
  69.             //print_r($resset2);
  70.  
  71.         }
  72.     }
  73. }
  74. echo "</tr>";
  75. echo "</table>";
  76. echo "</center>";
  77. $mysqli->close();
  78. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top