Guest User

Untitled

a guest
Sep 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. $host = 'localhost';
  4. $user = 'user';
  5. $password = 'password';
  6. $db_name = 'db_name';
  7. $connect = mysqli_connect($host, $user, $password);
  8.  
  9. mysqli_select_db($connect, $db_name) or die ("Couldn't connect");
  10.  
  11. function roll_die() {
  12.  
  13. $throw = rand(1, 6);
  14. return $throw;
  15. }
  16.  
  17. function get_subtotal() {
  18.  
  19. $query = "SELECT * FROM throws";
  20. $result = mysqli_query($connect, $query);
  21.  
  22. while ($row = $result->fetch_assoc()) {
  23. echo $row['value']."<br>";
  24. }
  25. }
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment