I have a difficulty to display an item of a student based on the student_name
. Previously I was able to display an item based on student_username
but not using student_name
. but now I want to use student_name
to display the item which from student_name
. I attached together with my code part.
<div class="row">
<!-- Welcome -->
<div class="col-lg-12">
<div class="alert alert-info">
<?php
include("connection.php");
$username=$_SESSION['username'];
$sql=mysql_query("SELECT student_name FROM register WHERE student_username='$username'");
$ee=mysql_fetch_array($sql);
?>
<i class="fa fa-folder-open"></i><b> Hello ! </b>Welcome Back <b><?php echo $ee['student_name']; ?> </b>
</div>
</div>
<!--end Welcome -->
</div>
<div class="row">
<div class="col-lg-12">
<div class="table table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>S.no</th>
<th>Parcel Number</th>
<th>Date Recieved</th>
<th>Date of Collected</th>
<th>Recieved Time</th>
<th>Collect Time</th>
<th>Status</th>
<th>Sent By</th>
<th>Sent To</th>
</tr>
</thead>
<?php
include("connection.php");
$sql1=mysql_query("SELECT * FROM add_parcel WHERE send_to='$username'");
$i=1;
while($row=mysql_fetch_array($sql1)){
echo '<tr class="record"><td>'.$i++.'</td><td>'.$row['date_recieve'].'</td><td>'.$row['date_collect'].'</td><td>'.$row['recieve_time'].'</td><td>'.$row['collect_time'].'</td><td>'.$row['status'].'</td><td>'.$row['sender_name'].'</td><td>'.$row['send_to'].'</td></tr>';
}
?>
add_parcel table = parcel_id,parcel_num,date_recieve,date_collect,recieve_time,collect_time,status,sender_name,send_to
register table = student_id,student_username,student_name,student_address,student_age,student_icenumber, student_email,student_phone,password