daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest May 17th, 2018 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <head>
  2.     <meta charset="utf-8"/>
  3. </head>
  4.  
  5. <?php
  6.  
  7. $mysqli = new mysqli('localhost', 'p99640tc_myapp', 'qwerty123', 'p99640tc_myapp');
  8. if ($mysqli->connect_errno) {
  9.     echo "ОШИБКА ПОДКЛЮЧЕНИЯ!";
  10. }
  11. $sql = "SELECT * FROM markers";
  12. if (!$result = $mysqli->query($sql)) {
  13.     echo "Извините, возникла проблема в работе сайта.";
  14.     exit;
  15. }
  16.  
  17. $markers = array();
  18. while ($marker = $result->fetch_assoc()) {
  19.     array_push($markers, $marker);
  20. }
  21.  
  22. echo json_encode($markers, JSON_UNESCAPED_UNICODE);
  23. /*
  24. while ($marker = $result->fetch_assoc()) {
  25.     echo $marker['name'];
  26. }
  27. */
  28.  
  29. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top