Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. https://api.parse.com/1/login?username="+username+"&password="+password
  2.  
  3. http://myadress.com/login.php
  4.  
  5. <?php
  6.  
  7. class ConnectionInfo {
  8. public $conn;
  9. public function GetConnection() {
  10.  
  11. $this->conn = mysqli_connect("serv", "user","pass", "db") or die(mysqli_error($mysql_pekare));
  12.  
  13. }
  14.  
  15. }
  16.  
  17. $connectionInfo = new ConnectionInfo();
  18. $connectionInfo->GetConnection();
  19.  
  20. if (!$connectionInfo->conn)
  21. {
  22. echo 'No Connection';
  23.  
  24. }
  25.  
  26. else
  27. {
  28. $query = 'SELECT * FROM users ORDER BY objectId';
  29.  
  30. $stmt = mysqli_query($connectionInfo->conn, $query);
  31.  
  32. if (!$stmt)
  33. {
  34. echo 'Query failed';
  35. }
  36.  
  37. else
  38. {
  39. $contacts = array();
  40.  
  41. while ($row = mysqli_fetch_array($stmt))
  42. {
  43.  
  44. $contact = array("ID" => utf8_encode ($row['objectId']),
  45. "Username" => utf8_encode ($row['username']),
  46. "Password" => $row['password']);
  47.  
  48. array_push($contacts, $contact);
  49.  
  50. }
  51.  
  52. echo json_encode(array('results' => $contacts), JSON_PRETTY_PRINT);
  53.  
  54. }
  55. }
  56.  
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement