Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once __DIR__.'/header2.php';
- if(!isset($_SESSION['u_uid'])) {
- header("Location: index.php?=mustloginfirst");
- exit();
- } else {
- include_once __DIR__.'/includes/dbh.php';
- $sql = "SELECT * FROM primervideos;";
- $stmt = mysqli_stmt_init($conn);
- if (!mysqli_stmt_prepare($stmt, $sql)) {
- echo "SQL error";
- } else {
- mysqli_stmt_execute($stmt);
- $result = mysqli_stmt_get_result($stmt);
- $resultCheck = mysqli_num_rows($result);
- echo '<table class="primervideos">
- <tr>
- <th colspan="2" class="update_title">Welcome to the Primer Videos' Section</th>
- </tr>';
- $rowCounter = 0;
- while($row = mysqli_fetch_assoc($result)) {
- $rowCounter++;
- if ($resultCheck < 1) {
- header("Location: header2.php?primervideos=nolessons");
- exit();
- } else {
- echo '<tr>
- <th>Result No:</th><td>',htmlspecialchars($rowCounter),'</td>
- </tr>
- <tr>
- <th>Lesson '.$rowCounter.':</th><td><a href="#">',htmlspecialchars($row['lessons']),'</a></td>
- </tr>
- <tr>
- <th>Date Submitted:</th><td>',htmlspecialchars($row['date_submitted']),'</td>
- </tr>';
- }
- }
- echo '</table>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement