benaust Posted June 25, 2008 Share Posted June 25, 2008 Hi there guys. I appreciate any help. This must have been done or I am having a wrong approach. I am trying to create a report from Mysql and saving it to PDF format. In order to do this I have to get the data into html then create the PDF. I need to create pages of 10 with a header title for each table, for as many as data there is in Mysql table. E.g. Table has 10 rows of data in it. Report 4 per page Page 1 Title table header row (Static html) Row 1 Row 2 Row 3 Row 4 Page 2 Title table header row (Static html) Row 5 Row 6 Row 7 Row 8 Page 3 Title table header row (Static html) Row 9 Row 10 My other concern is memory as the data size gets bigger and bigger. Any help appreciated Thanks Ben Link to comment https://forums.phpfreaks.com/topic/111923-solved-display-all-from-mysql-in-chunks-with-title-header-for-each-chunk/ Share on other sites More sharing options...
Barand Posted June 25, 2008 Share Posted June 25, 2008 $count = 0 while ($row = mysql_fetch_row($result)) { if ($count++ % 10 == 0) { // output heads } // output row data } Link to comment https://forums.phpfreaks.com/topic/111923-solved-display-all-from-mysql-in-chunks-with-title-header-for-each-chunk/#findComment-574475 Share on other sites More sharing options...
benaust Posted June 26, 2008 Author Share Posted June 26, 2008 Much simpler than I thought and it Works perfect. Thanks Mate. Link to comment https://forums.phpfreaks.com/topic/111923-solved-display-all-from-mysql-in-chunks-with-title-header-for-each-chunk/#findComment-574705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.