I'm new to JSON and I am writing a PHP script to take all the data from a remote MySQL db to import to a ios sqlite database. My plan is to take all the tables from each database and send it to the other and check if the rowid are in the right table, if it is, throw it out, if not add it to that database, basically adding whatever rows aren't in the database to it.
I am trying to read my JSON output from the remote MySql server and I dont quite understand it and can't find any good resources. For my login table I pull it like this:
$query = "SELECT * from answers";
$result = $this->db->query($query) or die('Errant query: '.$query);
$answers = array();
$answers=mysqli_fetch_array($result);
header('Content-type: application/json');
echo json_encode(array(
'login'=>$login,
'answers'=>$answers,
'projects'=>$projects,
'questions'=>$questions,
'surveys'=>$surveys,
));
Then when I read the output it shows for the login table:
{"login":{"0":"1","userid":"1","1":"test","password":"test","2":"1","aclevel":"1"},
The login table has three columns: userid, password, and aclevel. Filled in this table is 1, test, 1 respectively.
Can someone explain to me what the output of the JSON means?