I am working on a schdeuling system and i urgetly need your help. I have code running well,
$t_slot_time is the current timeslot, if condition is yes on line19, $t_slot_time increment by 2, and $t_slot_times becomes new time.
how can i repeat same process from 1 to 21 for the new timeslot $t_slot_times where $t_slot_time on line1 is replaced with the new $t_slot_times on line20 and subsequent values after increment until this $num_rowe >= 1 is not satisfied.
Thanks
1. $queuen = mysql_query("SELECT * FROM put_exam WHERE sess_id ='".$t_slot_time."'") or die(mysql_error());
2. $arrDatasa= array();
3. while($rowsa = mysql_fetch_array($queuen))
4. {
5. $arrDatasa[]=$rowsa['course_code']. '|';
6. $docam = array_filter($arrDatasa);
7. }
8. foreach($arrDatasa as $a=> $rowsa){
9. $docama.=$docam[$a];
10. }
//Store current coursecode to assisgn into currentass
$currentass = $e_course_code;
//Check for common student between the last assigned course and current course to be assigned, if yes increment timeslot by 2
11. $chkcomms = mysql_query("SELECT student.matric, student.std_name FROM student
12. JOIN course_reg e1 ON e1.matric=student.matric
13. JOIN course c1 ON c1.course_code=e1.course_code
14. JOIN course_reg e2 ON e2.matric=student.matric
15. JOIN course c2 on c2.course_code = e2.course_code
16. WHERE c1.course_code = '".$currentass."'
17. AND c2.course_code RLIKE '%$docama%'
17. GROUP BY student.matric") or die(mysql_error());
// Count number of rows
18. $num_rowe = mysql_num_rows($chkcomms);
19. if($num_rowe >= 1) {
20. $t_slot_times = $t_slot_time + 2;
21. }