Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "teste";
- $conn = new mysqli ($servername,$username,$password,$dbname);
- if ($conn->connect_error){
- die("Connection failed: " . $conn->connect_error);
- }
- $sql1 = "SELECT abbreviation,image FROM je";
- $result1 = $conn->query($sql1);
- $i=0;
- $resultado = array(array(),array());
- while ($row = $result1->fetch_assoc()){
- $resultado[$i]["imagem"] = $row["image"];
- $resultado[$i]["abrevia"] = $row["abbreviation"];
- $i++;
- }
- echo json_encode($resultado);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement