-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsu.php
More file actions
62 lines (40 loc) · 1.18 KB
/
Copy pathinsu.php
File metadata and controls
62 lines (40 loc) · 1.18 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
<?php
include "newcon.php";
$errors = [];
$username;
$game;
$amount;
if (isset($_GET["accept"])){
$id=$_GET["accept"];
$amount=$_GET["accept"];
$conn = new mysqli('localhost','root','','user-verification');
$sql = "SELECT * FROM wagers where id=$id";
$result = $conn-> query($sql);
if($result){
foreach($result as $row){
$amount=$row['amount'];
$game=$row['game'];
$username=$row['username'];
}
}
}
if($conn->connect_error){
die('connection failed : '.$conn->connect_error);
}
$vs=$_SESSION['username'];
$sql = "SELECT cash FROM users WHERE username='$vs'";
$result = mysqli_query($conn, $sql);
$cash_table;
if($result){
foreach($result as $row){
$cash_table=$row['cash'];
}
if ($cash_table < $amount) {
echo "you have insufficient funds";
}
else{
echo"sufficient";
}
$conn->close();
}
?>