Viewing file: result.php (3.31 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); ?> <?php include('session.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Student Login Panel </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type='text/javascript'> $(document).ready(function(){ $("img.a").hover( function() { $(this).stop().animate({"opacity": "0"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); });
}); </script> <style type="text/css"> table { border: 0px solid green; border-collapse: collapse; width:100%; }
table td { border: 0px solid green; }
table td.shrink { white-space:nowrap } table td.expand { width: 99% } </style> <style>
.table {
table-layout:fixed; width:500px;
border-collapse:collapse;
}
.header th {
font-family:Calibri; font-size:small; font-weight:lighter;
border-left:1px solid #000; background:#d0d0d0;
}
.body_panel {
display:inline-block; width:520px; height:300px; overflow-y:scroll;
}
.body tr {
border-bottom:1px solid #d0d0d0;
}
.body td {
border-left:1px solid #d0d0d0; padding-left:3px;
font-family:Calibri; font-size:small;
overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
} </style> </head> <center> <body class="w3-container"> <table >
<tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('menubar/menubar.php'); ?></td> </tr> <tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('sessionbar.php'); ?></td> </tr> <tr> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php'; // Attempt select query execution $sql = "SELECT * FROM answersheet WHERE roll_no='$user'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ echo "<table>"; echo "<tr>"; echo "<th>Sr.</th>"; echo "<th>Exam Date</th>"; echo "<th>Obtained Marks</th>"; echo "<th>Total Marks</th>"; echo "</tr>"; while($row = mysqli_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['id'] . "</td>"; echo "<td>" . $row['date'] . "</td>"; echo "<td>" . $row['correctanswer'] . "</td>"; echo "<td>" . $row['totlaquestion'] . "</td>"; echo "</tr>"; } echo "</table>"; // Close result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> </td> </tr> <tr> <td colspan="2" bgcolor="#CCCCCC"><?php include('footer/footer.php'); ?></td> </tr> </table>
</body></center> </html>
|