Hello, I'm having a problem with my code and I wanted your help.
I need to get data from a table and send it as json, I have 10 items in my table but json just sends one.
Table: Location
InmycodewhereIputallPHPandMsqli
include("connect.php");
header("Content-Type: application/json");
$queryString = "SELECT * FROM 'local'";
$query = mysqli_query($conexao, $queryString) or die(mysqli_error());
$paises = array();
while ($pais = mysqli_fetch_assoc($query)) {
$paises['paises'] = $pais['paises'];
}
echo json_encode($paises);
And it only returns me the last item that is the "argentina" and was the maximum that I got because I tried several ways. if you can help me there I thank you.