我有三张学生桌第一张是
其次是中心细节
三是客房细节
$anil = array();
$exam_no_students = array();
$session_usr['user']= $this->session->userdata('user_name');
$total_students['total_stu']=$this->DBfunction->totalCountAll('roll_no');
$exam_centers['no_of_centers']= $this->DBfunction->count_centers();
$exam_centers1= $this->DBfunction->count_centers();
foreach ($exam_centers1 as $center_code => $center_details){
$center_code = array('center_id' =>$center_details->center_id);
$center_table='exam_center';
$center_full_details =$this->DBfunction->getArrayWhereResult($center_table,$center_code);
foreach ($center_full_details as $full => $full_de) {
$fullstudent = array('center_f_id' =>$full_de->center_id,
'center_f_name' =>$full_de->exam_center,
'center_f_addres' =>$full_de->exam_center_address ,
'center_f_city' =>$full_de->village ,
'center_f_count' =>$center_details->count);
}
array_push($exam_no_students, $fullstudent);
$center_f_details =$this->DBfunction->getArrayWhereResult($center_table,$center_code);
foreach ($center_f_details as $roomss => $rooms) {
$room_id = array('exam_center_id' =>$rooms->id);
$center_rooms =$this->DBfunction->getArrayWhereResult('exam_center_rooms',$room_id);
foreach ($center_rooms as $rooms_c => $roomsdetails) {
$center_with_rooms['anil'] = array('center_id'=>$rooms->center_id,
'center_name'=>$rooms->exam_center,
'center_main'=>$roomsdetails->exam_center_id,
'no_of_students'=>$center_details->count,
'room_no'=>$roomsdetails->room_no,
'no_of_seating'=>$roomsdetails->noofseating, 'noofrow'=>$roomsdetails->noofrow,
'noofcol'=>$roomsdetails->noofcol
);
}
}
我想把学生安排到下表所示的房间进行考试
我真搞不懂怎么做。
1条答案
按热度按时间hfwmuf9z1#
我使用array\u slice()得到了上述查询的解决方案。达到预期效果。