-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwin.php
More file actions
88 lines (80 loc) · 1.45 KB
/
Copy pathwin.php
File metadata and controls
88 lines (80 loc) · 1.45 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
include "newcon.php";?>
<!DOCTYPE html>
<html>
<head>
<title> winningd</title>
<style>
table {
border: 1px solid black;
width: 80%;
color: #588c7e;
font-family: monospace;
font-size: 25px;
text-align: left;
}
th {
background-color: #588c7e;
color: white;
}
tr:nth-child(even) {background-color: #f2f2f2}
ul{
margin: 0px;
padding: 0px;
list-style: none;
}
ul li{
float: right;
width: 200px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 20px;
background-color: blue;
}
ul li a{
text-decoration: none;
color: black;
display: block;
}
.h2{
position: center;
}
</style>
</head>
<body>
<ul>
<li><a href="mywager.php">my wagers</a></li>
</ul>
<table>
<h2>wagers won</h2>
<tr>
<th>id</th>
<th>wager_id</th>
<th>username</th>
<th>amount won</th>
</tr>
<?php
$conn = new mysqli('localhost','root','','user-verification');
if($conn-> connect_error){
die("connection failed:". $conn-> connect_error);
}
$username=$_SESSION['username'];
$sql = "SELECT * FROM awarded WHERE username='$username'";
$result = $conn-> query($sql);
if($result-> num_rows> 0){
while($row = $result-> fetch_assoc()){
echo"<tr>
<td>". $row["id"]."</td>
<td>". $row["wagerid"]."</td>
<td>". $row["username"]."</td>
<td>". $row["won"]."</td>
</tr>";
}
echo "</table>";
}
else{
echo "0 result";
}
$conn-> close();
?>