Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. $db_host = 'localhost'; // Server Name
  3. $db_user = 'root'; // Username
  4. $db_pass = ''; // Password
  5. $db_name = ''; // Database Name
  6.  
  7. $conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
  8. if (!$conn) {
  9. die('Failed to connect to MySQL: ' . mysqli_connect_error());
  10. }
  11.  
  12.  
  13.  
  14. $sql = "SELECT Money FROM Account";
  15.  
  16.  
  17. $query = mysqli_query($conn, $sql);
  18.  
  19.  
  20. if (!$query) {
  21. die('SQL Error: ' . mysqli_error($conn));
  22. }
  23. ?>
  24.  
  25. <?php while( $row = $sql->fetch()) : ?>
  26.  
  27. Balance<!-- react-text: 7 --><?php echo $row['Money']; ?><!-- /react-text -->
  28.  
  29. <?php endwhile ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement