pull.php 528 B

1234567891011121314151617181920
  1. <?php
  2. $bssid = $_POST ["bssid"];
  3. $timestamp = $_POST ["timestamp"];
  4. $username = "hostage";
  5. $password = "hostageDB";
  6. $hostname = "localhost";
  7. $dbhandle = mysql_connect ( $hostname, $username, $password ) or die ( "Unable to connect to MySQL" );
  8. $result = mysql_query ( "SELECT * FROM `hostage`.`sync` WHERE `bssid` = " . $bssid . " AND `timestamp` > " . $timestamp );
  9. if (! $result) {
  10. die ( 'Could not select record: ' . mysql_error () );
  11. }
  12. while ( $row = mysql_fetch_array ( $result ) ) {
  13. echo json_encode ( $row );
  14. }
  15. ?>