Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="plugin/jquery-3.2.1.js"></script>
- <script src="plugin/datatables.min.js"></script>
- <link href="plugin/datatables.min.css" rel="stylesheet">
- <script src="plugin/canvasjs.min.js"></script>
- <script srrc="plugin/jqBarGraph.1.1.js"></script>
- <?php
- $server = "localhost";
- $username = "root";
- $password = "";
- $dbname = "quiz1";
- $conn = new mysqli($server, $username, $password, $dbname);
- $que = "SELECT ClassCode, ClassName, FirstName, LastName, Score FROM class c, studentclass sc, students s WHERE c.ID=sc.ClassID AND s.ID=sc.StudentID ";
- $result = $conn->query($que);
- echo"
- <script>
- $(document).ready(function() {
- $('#example').DataTable();
- })
- </script>
- <html>
- <head>
- <title> EXAMPLE </title>
- </head>
- <body>
- <table id='example' class='display' cellspacing='0' width='100%'>
- <thead>
- <tr>
- <th>Firstname</th>
- <th>lastname</th>
- <th>classname</th>
- <th>Score</th>
- </tr>
- </thead>
- <tbody>
- ";
- while($row = $result->fetch_assoc()){
- $classcode = $row["ClassCode"];
- $classname = $row["ClassName"];
- $firstname = $row["FirstName"];
- $lastname = $row["LastName"];
- $score = $row["Score"];
- echo"
- <tr>
- <td>$firstname</td>
- <td>$lastname</td>
- <td>$classname</td>
- <td>$score</td>
- </tr>
- ";
- echo json_encode($firstname);
- }
- echo"
- </tbody>
- </table>
- <script>
- </script>
- </body>
- </html>
- ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement