Fill the array before issuing in JSON format as follows:
$json_data = array('from_login'=>$rows[$j]['from_login'], 'message_enc_from_key'=>$rows[$j]['message_enc_from_key'], 'who_login'=>$rows[$j]['who_login'], 'message_enc_who_key'=>$rows[$j]['message_enc_who_key'], 'date_time'=>$rows[$j]['date_time'] ); echo json_encode($json_data); There was a question how to fill this array with the array_push method. Tried like this:
array_push($json_data, 'from_login'=>$rows[$j]['from_login']); But it gives an error of 500. What have I missed and am doing wrong?