Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "id1628750_camilo";
- $password = "1234qwer";
- $dbname = "id1628750_cappital";
- $con = mysqli_connect($servername, $username, $password, $dbname);
- // query the application data
- $sql = "SELECT Nombre, Cantidad, Fecha FROM EMAIL_TABLA WHERE Tipo<=2 ORDER BY Fecha";
- $result = mysqli_query($con, $sql);
- // an array to save the application data
- $rows = array();
- // iterate to query result and add every rows into array
- while($row = mysqli_fetch_assoc($result)) {
- $rows[] = $row;
- }
- // close the database connection
- mysqli_close($con);
- // echo the application data in json format
- echo json_encode($rows);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement