Advertisement
Guest User

Untitled

a guest
May 22nd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2. <?php
  3. ini_set('display_errors', 1);
  4. error_reporting(E_ALL);
  5. $host = 'localhost';
  6. $username = '';
  7. $password = '';
  8. $database = '';
  9. $conn = mysqli_connect($host,$username,$password,$database);
  10.  
  11. $SteamID = "STEAM_0:0:81010017";
  12. $sql_query="SELECT _Inventory FROM Players Where _SteamID='$SteamID'";
  13.  
  14. $result=mysqli_query($conn,$sql_query);
  15. $in = mysqli_fetch_array($result)[0];
  16. ?>
  17. <table>
  18. <tr>
  19. <th>Item:</th>
  20. <th>Quantity:</th>
  21. <th>Sell</th>
  22. </tr>
  23. <?php
  24. foreach (explode(";", $in) as $element) {
  25. $element = trim($element);
  26. if (strpos($element, " ") !== false ) {
  27. list($car, $number) = explode(" ", $element);
  28. ?>
  29. <tr>
  30. <td><?php echo $car; ?></td>
  31. <td><?php echo $number; ?></td>
  32.  
  33. </tr>
  34. <?php
  35.  
  36.  
  37. }
  38.  
  39. }
  40. echo "</table>";
  41.  
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement