Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // Create connection
  2. $conn = new mysqli($servername, $username, $password, $dbname);
  3. // Check connection
  4. if ($conn->connect_error) {
  5. die("Connection failed: " . $conn->connect_error);
  6. }
  7.  
  8.  
  9. $sql = "SELECT Status FROM Users WHERE Username = '".$_GET["username"]."' AND Password = '".$_GET["password"]."'";
  10. $result = $conn->query($sql);
  11.  
  12. if ($result->num_rows > 0) {
  13. // output data of each row or remove while loop if you wish
  14. while($row = $result->fetch_assoc()) {
  15. echo $row['Status'] ;
  16. }
  17. } else {
  18. echo "0 results";
  19. }
  20. $conn->close();
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement