Advertisement
Guest User

Widdup

a guest
Nov 26th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "Stu445";
  4. $password = "Stu4998!";
  5. $dbname = "stu445";
  6. $conn = new mysqli($servername,$username,$password,$dbname);
  7. if ($conn->connect_error) {
  8. die("Connection failed: " . $conn->connect_error);
  9.  
  10. }
  11.  
  12. // Shows Table information
  13. $Select = "SELECT * FROM comments";
  14. $Result = $conn->query($Select);
  15. if ($Result->num_rows > 0){
  16. while ($row = $Result->fetch_assoc()) {
  17. echo "Record ID: " . $row['ID'];
  18. echo "<br />";
  19. echo "Name: " . $row['Name'];
  20. echo "<br />";
  21. echo "Comment: " . $row['Comments'];
  22. echo "<br />";
  23. echo "<br />";
  24. }
  25. }
  26.  
  27. $conn->close();
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement