0
I’m a beginner in programming and I’m developing an android application that uses PHP and requests with Mysql. I initially tested all the features on the local server to then migrate it to an online server, in this case, Hostinger.
One of my PHP files returns the value of an array correctly on the local server, but when using the same PHP file on the online server with the same database, the array only responds as TRUE when running echo
.
I tested by echo each line and it is working perfectly, just not being able to associate the values to Keys.
$resultado = array();
$ordenado = mysqli_query($connect, $ordenarExercicio);
while ($pacientes = $ordenado->fetch_assoc()){
echo $pacientes['grupo']; //imprime OK
echo $pacientes['nome_exercicio']; //imprime OK
echo $pacientes['utilizar_exercicio']; //imprime OK
$resultado[] = array("grupo" => $pacientes['grupo'],
"nome" => $pacientes['nome_exercicio'],
"habilitar" => $pacientes['utilizar_exercicio']
);
}
echo json_encode($resultado); //imprime TRUE
It is the paid version. I have access to the bank by phpmyadmin. In this same file there are 2 other queries that work perfectly. The data is being passed correctly, only the array that is returning wrong.
– Rodrigo Ferraz