Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "sql205.byethost18.com";
- $username = "b18_22249963";
- $password = "Ruby!234";
- $dbname = "b18_22249963_Jewels ";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn-<connect_error)
- {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT id, firstname, lastname FROM MyGuests";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement