Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. $servername = "localhost";
  6. $username = "root";
  7. $password = "htq6m2";
  8. $dbname = "transactions";
  9.  
  10. // Create connection
  11. $conn = new mysqli($servername, $username, $password, $dbname);
  12. // Check connection
  13. if ($conn->connect_error) {
  14. die("Connection failed: " . $conn->connect_error);
  15. }
  16.  
  17. $query = "SELECT sum(points) AS points FROM transactions WHERE username = '".mysqli_real_escape_string($conn,$_SESSION['userid'])."'";
  18. $result = mysqli_query($conn, $query);
  19. $row = mysqli_fetch_assoc($result);
  20.  
  21. if ($_GET["credits"] > $results) {
  22. echo("You don't have enough credits for that bet!");
  23. } else {
  24. echo("Nice you've got enough credits!")
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement