SHARE
TWEET

Untitled

a guest May 26th, 2018 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "root";
  5. $dbname = "mydb";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11.     die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $sql = "SELECT * FROM login WHERE username = 'foo' AND password
  15. = 'bar' ";
  16. $result = $conn->query($sql);
  17. while ($row = $result->fetch_assoc()) {
  18.       echo ("%s (%s)n", $row["username"], $row["password"]);
  19.   }
  20. echo $row;
  21.  
  22. $conn->close();
  23. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top