-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtblclg.php
60 lines (53 loc) · 1.73 KB
/
tblclg.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include("logic/connection.php");
$clgid=$_REQUEST['clg'];
?>
<table border="1">
<tr>
<td><b>sid</b></td>
<td><b>name</b></td>
<td><b>number</b></td>
<td><b>degree</b></td>
<td><b>course</b></td>
<td><b>college</b></td>
</tr>
<tr>
<?php
$query=mysqli_query($con,"SELECT * FROM `student` where college='$clgid'");
$total=mysqli_num_rows($query);
if($total!=0){
$f=0;
while($result=mysqli_fetch_assoc($query)){
$deg=$result['degree'];
$name=$result['name'];
$number=$result['number'];
$crs=$result['course'];
$clg=$result['college'];
$f++;
?>
<tr>
<td><?php echo $f;?></td>
<td><?php echo $name;?></td>
<td><?php echo $number;?></td>
<td><?php
$query2=mysqli_query($con,"SELECT * FROM `degree` where degreeid='$deg'");
while($result2=mysqli_fetch_assoc($query2)){
$degnm=$result2['degreename'];
}
echo $degnm; ?></td>
<td><?php $query3=mysqli_query($con,"SELECT * FROM `course` where courseid='$crs'");
while($result3=mysqli_fetch_assoc($query3)){
$crsnm=$result3['coursename'];
}
echo $crsnm; ?></td>
<td><?php $query4=mysqli_query($con,"SELECT * FROM `college` where collegeid='$clg'");
while($result4=mysqli_fetch_assoc($query4)){
$clgnm=$result4['collegename'];
}
echo $clgnm; ?></td>
<?php }}else{
?>
<td>there is no data</td>
<?php }?>
</tr>
</table>