Advertisement
Sahitya-K

Show balance for every user in login

May 21st, 2022
908
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <style>
  4.             table {
  5.   font-family: arial, sans-serif;
  6.   border-collapse: collapse;
  7.   width: 100%;
  8. }
  9.  
  10. td, th {
  11.   border: 1px solid #dddddd;
  12.   text-align: left;
  13.   padding: 8px;
  14. }
  15.  
  16. tr:nth-child(even) {
  17.   background-color: #dddddd;
  18. }
  19.         </style>
  20.     </head>
  21.     <body>
  22.  
  23.  
  24. <?php
  25.  
  26. include 'conn.php';
  27.  
  28.  
  29. $query = "SELECT * FROM login";
  30. $results=mysqli_query($conn,$query);
  31. $row_count=mysqli_num_rows($results);
  32.  
  33. echo "<table>";
  34. while ($row = mysqli_fetch_array($results)) {
  35.  
  36. $user = $row['username'];
  37. echo "<tr><td>".$user."</td></tr>";
  38.  
  39. $hi = mysqli_query($conn, "SELECT sum(balance) from balance WHERE address='$user'");
  40. $jig = mysqli_fetch_array($hi);
  41. echo "<td>". $jig[0] . "</td>";
  42.  
  43. }
  44.  
  45.     ?>
  46.    
  47.     </body>
  48. </html>
Advertisement
RAW Paste Data Copied
Advertisement