0
In a Get using PHP I am making the request of 2 columns this way:
<?php
include 'conexao.php';
header('Content-Type: text/html; charset=UTF-8');
//Converte para UTF8 os resultados da query
mysql_set_charset('UTF8');
//Retorna resultado query idRegistro e updateatRegistro
$sql = "SELECT idRegistro,updateatRegistro FROM jump";
$resultado = mysql_query($sql) or die ("Erro: ".mysql_error());
// Crinha variável linha do tipo array
$linha = array();
while($r = mysql_fetch_assoc($resultado))
{
$linha [] = $r;
}
echo json_encode($linha);
mysql_close();
?>
And I’m trying to get the values. However, I realized that in responseData, I’m getting an answer with 2 layers of arrays and 1 dictionary:
thus:
1º Array |2º Array| Dicionario
[0] = [0] = idRegistro: 1;
[1] = updateAt: 2015/02/18 19:55:42;
When I try to extract the data from the first layer of the array, the return should be another array, but it is being recognized as a dictionary. I believe it is due to Json encoding.
I believe I should query these columns in another way. Someone could suggest a better way?