pull.php 481 B

123456789101112131415161718192021
  1. <?php
  2. $bssid = $_POST ["bssid"];
  3. $username = "hostage";
  4. $password = "hostageDB";
  5. $hostname = "localhost";
  6. $dbhandle = mysql_connect ( $hostname, $username, $password ) or die ( "Unable to connect to MySQL" );
  7. $query = "SELECT * FROM `hostage`.`sync` WHERE `bssid` = '" . $bssid . "'";
  8. $result = mysql_query ( $query );
  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. ?>