while row results- fetchArray data name row name lastName row lastName

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
while ($row = $results->fetchArray()) {
$data = ['name'=>$row['name']
,'lastName'=>$row['lastName']
,'fatherName'=>$row['fatherName']
,'id'=>$row['id']
,'block'=>$row['block']
,'apart'=>$row['apart']
,'course'=>$row['course']
,'group'=>$row['group'];
}
$json_data = array ('status'=>"OK", 'user'=>$data);
echo json_encode($json_data);