-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrategy.php
59 lines (52 loc) · 1.81 KB
/
strategy.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
<?php
if($_GET["request"]=="profile-update" && $_GET["status"]=="success"){
$dialogue="Your profile update was successful! ";
}
else if($_GET["request"]=="profile-update" && $_GET["status"]=="unsuccess"){
$dialogue="Your profile update was not at all successful! ";
}
else if($_GET["request"]=="login" && $_GET["status"]=="success"){
$dialogue="Welcome back again! ";
}
?>
<?php
include '_database/database.php';
session_start();
$current_user = $_SESSION['user_username'];
?>
<head>
<link rel="stylesheet" href="./mdl/material.min.css">
<script src="./mdl/material.min.js"></script>
<link rel="stylesheet" src="./RobotoTFF/Roboto-Regular.tff">
<?php echo '<link rel="stylesheet" type="text/css" href="style.css">';?>
</head>
<?php
//test if connection failed
if(mysqli_connect_errno()){
die("connection failed: "
. mysqli_connect_error()
. " (" . mysqli_connect_errno()
. ")");
}
$TeamNum = mysqli_real_escape_string($database, $_POST['TeamNum']);
//get results from database
$result = mysqli_query($database,"SELECT * FROM 2017_game.mytable WHERE teamnum='$TeamNum'");
$all_property = array(); //declare an array for saving property
//showing property
echo '<table class="data-table">
<tr class="data-heading">'; //initialize table tag
while ($property = mysqli_fetch_field($result)) {
echo '<td>' . $property->name . '</td>'; //get field name for header
array_push($all_property, $property->name); //save those to array
}
echo '</tr>'; //end tr tag
//showing all data
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
foreach ($all_property as $item) {
echo '<td>' . $row[$item] . '</td>'; //get items using property value
}
echo '</tr>';
}
echo "</table>";
?>