Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "username";
  4. $password = "password";
  5. $dbname = "myDB";
  6.  
  7. $sql = "SELECT id, firstname, lastname FROM MyGuests";
  8. $result = $conn->query($sql);
  9.  
  10. if ($result->num_rows > 0) {
  11. // output data of each row
  12. while($row = $result->fetch_assoc()) {
  13. echo "<br> custom1: ". $row["custom1"]. " custom2: ". $row["customer2"]. "cust3 " . $row["custom3] . "<br>";
  14. }
  15. } else {
  16. echo "0 results";
  17. }
  18.  
  19. $conn->close();
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement