Advertisement
BilkaPek

debug_page

Dec 1st, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. /*
  3.  * Go to http://your_domaine/index.php?page=debug_page
  4.  * GET Live Data From DataBase for Debeug(VAM)
  5.  * Copy this file to your vam directory
  6. */
  7. header("Content-type: application/json");
  8. //include('/db_login.php');
  9. $db = new mysqli($db_host, $db_username, $db_password, $db_database);
  10. $db->set_charset("utf8");
  11. if ($db->connect_errno > 0) {
  12.     die();
  13. }
  14.  
  15. $query = 'SELECT ident, name, type FROM airports LIMIT 10';
  16.  
  17. $json_data=array();
  18. $result = $db->query($query);
  19. while ($rec = $result->fetch_assoc())
  20. {
  21.     $json_data['Airport_Debeug'][] = $rec;
  22. }
  23. echo json_encode($json_data);
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement