Advertisement
Guest User

Untitled

a guest
Aug 9th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. $servername = "mysql.hostinger.in";
  3. $username = "u604844745_stef";
  4. $password = "testing123";
  5.  
  6. $conn = mysql_connect($servername, $username, $password)
  7. or die("Unable to connect to MySQL");
  8. echo "Connected to MySQL<br>";
  9. $email = $_GET['email'];
  10.  
  11.  
  12. $sqldata = mysql_query("SELECT * FROM u604844745_masu.users WHERE u604844745_masu.users.email='$email'");
  13.  
  14.  
  15. $rows = array();
  16. while($r = mysql_fetch_assoc($sqldata)) {
  17. $rows['id'] = $r['id'];
  18. $rows['first_name'] = $r['name'];
  19. $rows['last_name'] = $r['lastname'];
  20. $rows['email'] = $r['email'];
  21. $rows['phone'] = $r['mobile'];
  22.  
  23. }
  24.  
  25. echo json_encode($rows);
  26. mysql_close($conn);
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement