Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://api.parse.com/1/login?username="+username+"&password="+password
- http://myadress.com/login.php
- <?php
- class ConnectionInfo {
- public $conn;
- public function GetConnection() {
- $this->conn = mysqli_connect("serv", "user","pass", "db") or die(mysqli_error($mysql_pekare));
- }
- }
- $connectionInfo = new ConnectionInfo();
- $connectionInfo->GetConnection();
- if (!$connectionInfo->conn)
- {
- echo 'No Connection';
- }
- else
- {
- $query = 'SELECT * FROM users ORDER BY objectId';
- $stmt = mysqli_query($connectionInfo->conn, $query);
- if (!$stmt)
- {
- echo 'Query failed';
- }
- else
- {
- $contacts = array();
- while ($row = mysqli_fetch_array($stmt))
- {
- $contact = array("ID" => utf8_encode ($row['objectId']),
- "Username" => utf8_encode ($row['username']),
- "Password" => $row['password']);
- array_push($contacts, $contact);
- }
- echo json_encode(array('results' => $contacts), JSON_PRETTY_PRINT);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement