Guest User

Untitled

a guest
Sep 4th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "somepass";
  5. $dbname = "gamewebsitedatabase";
  6.  
  7. // Create connection
  8. $conn = mysqli_connect($servername, $username, $password, $dbname);
  9. // Check connection
  10. if (!$conn) {
  11. die("Connection failed: " . mysqli_connect_error());
  12.  
  13. }
  14.  
  15. $q = "select * from weapons";
  16. $result = $conn->query($q);
  17.  
  18. ?>
  19. <table align="center">
  20. <tr>
  21. <th>Image</th>
  22. <th>Name</th>
  23. <th>type</th>
  24. <th>rarity</th>
  25.  
  26. </tr>
  27. <?php
  28.  
  29. while($row = $result->fetch_assoc()) {
  30. echo "<tr>";
  31. echo "<td><img src='".$row['weapon_icon']."' width=199 height=188 />";
  32. echo "<td>".$row["weapon_name"]."</td>";
  33. echo "<td>".$row["weapon_type"]."</td>";
  34. echo "<td>".$row["weapon_rarity"]."</td>";
  35. echo "</tr>";
  36. echo "</table>";
  37. }
  38. ?>
Add Comment
Please, Sign In to add comment