Advertisement
Guest User

Untitled

a guest
Oct 31st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "10.128.1.131";
  4. $username = "fedora";
  5. $password = "password";
  6. $dbname = "protoss1";
  7.  
  8. $conn = mysqli_connect($servername, $username, $password, $dbname);
  9. if (!$conn) {
  10.     die("Connection failed: " . mysqli_connect_error());
  11. }
  12.  
  13. $result = mysqli_query($con,"SELECT * FROM build2");
  14.  
  15. echo "<table border='1'>
  16. <tr>
  17. <th>name</th>
  18. <th>units</th>
  19. <th>number</th>
  20. </tr>";
  21.  
  22. while($row = mysqli_fetch_array($result))
  23. {
  24. echo "<tr>";
  25. echo "<td>" . $row['name'] . "</td>";
  26. echo "<td>" . $row['units'] . "</td>";
  27. echo "<td>" . $row['number'] . "</td>";
  28. echo "</tr>";
  29. }
  30. echo "</table>";
  31.  
  32. mysqli_close($conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement