€scap€...!
New Member
I am creating a timetable in pdf format via dompdf and i am having some problem regarding the loops and new page.What i want is , when the teacher id changes, it should automatically create another page with the same htmlI am putting a sample code which can explain what exactly i want: \[code\] <?php include ("includes/functions.php"); require_once("dompdf/dompdf_config.inc.php"); ob_start(); $dompdf = new DOMPDF(); $q11 = "select id from teachers order by teacher"; $r11 = mysql_query($q11) or die(mysql_error()); $teacher = $rows11['id']; $q1="SELECT tt.day as day, tt.period as period, tt.egstatus as egstat, tt.resp_id as id, tt.sub_group, tt.filter, c.shortname as c_s, p.shortname as p_s, tt.teacherid, tt.subjectid as subject, r.room as room, t.apd1 as apd1, t.apd2 as apd2, g.groupname as class, t.teacher as teacher, p.courseid as course, p.partno as part FROM course c, papers p, ttresponsibility tt, teachers t, groups g, rooms r where c.id=p.courseid and p.paperid = tt.subjectid and tt.teacherid= t.id and tt.room=r.room_id and tt.groupname=g.group_id and tt.teacherid = '$teacher' order by tt.day,tt.period,p.partno ASC"; $r1 = mysql_query($q1) or die ("responsibility fetch error:" .mysql_error()); if(mysql_num_rows($r1) > 0){ $html="sample html"; } } $dompdf->load_html($html); $dompdf->set_paper('a4', 'landscape'); $dompdf->render(); $dompdf->stream('my.pdf',array('Attachment'=>0)); ?>\[/code\]Now this is the code. What i want is, when the next teacher comes in, it should go to the next page with the same html and do this till the end.Thanks in advance