-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresults.php
More file actions
65 lines (51 loc) · 1.17 KB
/
results.php
File metadata and controls
65 lines (51 loc) · 1.17 KB
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
61
62
63
<html><body>
<?php
$user="morris";
$password="rooski";
$database="ninjabunny_org";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$sql = "SELECT * FROM sports";
$result = mysql_query($sql2);
$i = 0;
$j = 0;
$event= 0;
$type = 0;
$speed = 0;
$strength = 0;
$strategy = 0;
$run = 0;
$jump = 0;
$ball = 0;
$contact = 0;
$endurance = 0;
$sweat = 0;
$heart = 0;
$stick = 0;
$race = 0;
$vehicle = 0;
$skill = 0;
$time = 0;
$stadium = 0;
$cheer = 0;
$league = 0;
$tv = 0;
$ref = 0;
$judges = 0;
$music = 0;
$sport = 0;
$ip= 0;
$location= 0;
// printing HTML result
while($line = mysql_fetch_row($result2)){
if ($line[24]) {
$strength = $strength + $line[3];
$strategy = $strategy + $line[4];
}
$sport = $sport + $line[24];
$j = $j + 1;
}
$percent_strength = 100 * $stregth / $sport;
$percent_strat = 100 * $strategy / $sport;
print "<p>To date, $percent_stregth % of all sports require strength
and $percent_strat % require strategy.<p>";