Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "liferay";
  5. $dbname = "lportal";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $emparray = array();
  15. $sql = "SELECT uuid_, urbanatweetId, userId, userName, createDate, text_, hashtag, retweet, followers, polaridad FROM VZ_Urbanatweet";
  16. $result = $conn->query($sql);
  17.  
  18. $output = array();
  19.  
  20. while ($row = mysqli_fetch_assoc($result)) {
  21. $output[] = array_map('utf8_encode', $row);
  22. }
  23.  
  24. print(json_encode($output));
  25.  
  26. $conn->close();
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement