Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "somepass";
- $dbname = "gamewebsitedatabase";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $q = "select * from weapons";
- $result = $conn->query($q);
- ?>
- <table align="center">
- <tr>
- <th>Image</th>
- <th>Name</th>
- <th>type</th>
- <th>rarity</th>
- </tr>
- <?php
- while($row = $result->fetch_assoc()) {
- echo "<tr>";
- echo "<td><img src='".$row['weapon_icon']."' width=199 height=188 />";
- echo "<td>".$row["weapon_name"]."</td>";
- echo "<td>".$row["weapon_type"]."</td>";
- echo "<td>".$row["weapon_rarity"]."</td>";
- echo "</tr>";
- echo "</table>";
- }
- ?>
Add Comment
Please, Sign In to add comment