-
Notifications
You must be signed in to change notification settings - Fork 0
/
bargraph1.php
31 lines (30 loc) · 897 Bytes
/
bargraph1.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
<?php
include('connection.php');
$query="SELECT ranks.points_fk,points.rank,ranks.schoolname,ranks.cityname,ranks.statename,points.score FROM ranks,points WHERE ranks.points_fk=points.id ORDER BY points.rank";
$data=mysqli_query($conn,$query);
$total=mysqli_num_rows($data);
$i=0;
if($total !=0)
{
while($result =mysqli_fetch_assoc($data))
{ $i++;
$id=$result['points_fk'];
$q="SELECT * FROM points WHERE id='$id' ";
$d=mysqli_query($conn,$q);
$t=mysqli_num_rows($d);
if($t!=0)
{
while($r=mysqli_fetch_assoc($d))
{ $records = array();
$records[]=$r;
echo $i;
}
}
}
echo $i;
}
else
{
echo "No Record Found";
}
?>