Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ($res = $result->fetch_assoc()) {
- echo "<tr><td>" . $res['subname'] . "</td>";
- $result2 = mysqli_query($mysqli, "SELECT *
- FROM grades
- JOIN gradesets ON grades.gradeset_id = gradesets.id
- WHERE grades.student_id = {$row['id']}
- AND grades.subject_id = {$res['id']}
- ORDER BY grades.gradeset_id ") or die($mysqli->error);
- while ($res2 = $result2->fetch_assoc()) {
- echo "<td>" . $res2['grade'] . "</td>";
- //echo "<td>" . $res2['gradeset_id'] . "</td>";
- //print_r($res2);
- $resset = $res2['gradeset'];
- $resset2 = substr($resset, -1);
- //print_r($resset);
- //print_r($resset2);
- }
- }
- $student = $mysqli->query("SELECT * FROM student");
- echo "<center>";
- echo "<h2>Data Wall</h2>";
- echo "<h3>PHP</h3>";
- echo "<hr/>";
- while ($row = $student->fetch_assoc()) {
- echo "<table border='1'>
- <tr>
- <th>ID</th>
- <th>STUDENT</th>
- <th>HOUSE</th>
- </tr><br>";
- echo "<tr>";
- echo "<td>" . $row['id'] . "</td>";
- echo "<td>" . $row['stuname'] . "</td>";
- echo "<td>" . $row['house'] . "</td>";
- echo "</tr><br><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>";
- echo "<tr><th>SUBJECTS</th><th>PC1</th><th>PC2</th><th>PC3</th><th>PC4</th></tr>";
- $result = mysqli_query($mysqli, "SELECT subjects.id,subjects.subname
- FROM student
- JOIN grades ON student.id = grades.student_id
- JOIN subjects ON subjects.id = grades.subject_id
- WHERE student.id = {$row['id']}
- GROUP BY subjects.subname ORDER BY subjects.id ") or die($mysqli->error);
- while ($res = $result->fetch_assoc()) {
- echo "<tr><td>" . $res['subname'] . "</td>";
- $result2 = mysqli_query($mysqli, "SELECT *
- FROM grades
- JOIN gradesets ON grades.gradeset_id = gradesets.id
- WHERE grades.student_id = {$row['id']}
- AND grades.subject_id = {$res['id']}
- ORDER BY grades.gradeset_id ") or die($mysqli->error);
- while ($res2 = $result2->fetch_assoc()) {
- echo "<td>" . $res2['grade'] . "</td>";
- //echo "<td>" . $res2['gradeset_id'] . "</td>";
- //print_r($res2);
- $resset = $res2['gradeset'];
- $resset2 = substr($resset, -1);
- //print_r($resset);
- //print_r($resset2);
- }
- }
- }
- echo "</tr>";
- echo "</table>";
- echo "</center>";
- $mysqli->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement