Last active
June 3, 2017 00:47
-
-
Save 64lines/724bfc7a7f29458e11c4d9a910d34881 to your computer and use it in GitHub Desktop.
Obtener Datos de los Tweets a través de un Servicio PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $servername = "localhost"; | |
| $username = "root"; | |
| $password = "liferay"; | |
| $dbname = "lportal"; | |
| // Create connection | |
| $conn = new mysqli($servername, $username, $password, $dbname); | |
| // Check connection | |
| if ($conn->connect_error) { | |
| die("Connection failed: " . $conn->connect_error); | |
| } | |
| $emparray = array(); | |
| $sql = "SELECT uuid_, urbanatweetId, userId, userName, createDate, text_, hashtag, retweet, followers, polaridad FROM VZ_Urbanatweet"; | |
| $result = $conn->query($sql); | |
| $output = array(); | |
| while ($row = mysqli_fetch_assoc($result)) { | |
| $output[] = array_map('utf8_encode', $row); | |
| } | |
| print(json_encode($output)); | |
| $conn->close(); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment