Please help me out of this problem.
I’ve a table named “students” having rows like “registration”, “name”, “gender”, “address” etc. (registration" is the “UNIQUE KEY”)
I’ve made our sub-centre’s login page where they can see how many total number of students they have admitted.
But I want to display the students’ details like their name, address in a page. Suppose a centre has admitted 10 students, then in their login page they can see their students’ details in a table. I’ve made the code but it only shows the registration number. Please help. Here is the code:
[php]<?php
include ‘dbc.php’;
/page_protect();
?>
|
<?php
if (isset($_SESSION['user_id'])) {
$admitted = $_SESSION['user_name'];
$query = mysql_query("select * from students where centre='$admitted'") or die(mysql_error());
list($admition) = mysql_fetch_row($query);
?>
<?php }
if (checkAdmin()) {
?>
<?php } ?>
|
Welcome <?php echo $_SESSION['user_name'];?><?php if (isset($_GET['msg'])) { echo "$_GET[msg] ";
}
?>
|
|
| <?php echo $admition;?> |