rescape($fio2).'"'; $rez = $DB->QUR_SEL($sql); if($rez){ foreach($rez as $k => $v)if($k!=0){ $sql1 = 'SELECT id FROM acs_teachers WHERE id_user=' . $v['id'] . ''; $rez1 = $DB->QUR_SEL($sql1); if ($rez1) { $rez[$k]['is_teacher'] = 1; } else { $rez[$k]['is_teacher'] = 0; $sql1 = 'SELECT gr.sokr FROM acs_students as st, acs_grupp as gr WHERE st.id_user=' . $v['id'] . ' AND st.id_grupp=gr.id'; $rez1 = $DB->QUR_SEL($sql1); if ($rez1) { $tmp = explode('-',$rez1[1]['sokr']); $rez[$k]['gruppa'] = $rez1[1]['sokr']; $rez[$k]['kurs'] = mb_substr($tmp[1],0,1); } } } echo json_encode($rez,JSON_UNESCAPED_UNICODE); } } exit(); }