473,385 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

page break after every 5 records

232 100+
i want page break after every 5 records but my code is not working
kindly help
Expand|Select|Wrap|Line Numbers
  1. while($row = mysql_fetch_array($result))
  2.   {
  3.     $i++;
  4.   if($i%5==0){
  5.       echo $i;
  6.  
  7. echo"<DIV style='page-break-after:always'></DIV>"; }
  8.  
  9.   ?>
  10.               <tr> 
  11.                 <td><?php echo $row[address];?></td>
  12. </tr>
  13.               <?php
  14.               }?>
  15.             </table>
Sep 1 '09 #1
2 4943
dlite922
1,584 Expert 1GB
Why is it not working? Can you view source in the browser copy and paste some records of that table? is $i set to 0 before your while loop?

I hope you didn't mean pagination, because this is not how you do it.



Dan
Sep 1 '09 #2
Dormilich
8,658 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. <DIV style='page-break-after:always'></DIV>
does your User Agent actually support this?
Sep 1 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mel Draper | last post by:
Hello there, I've created a report from a SQL table that has a minimum of 150 records. I need a printer friendly version and with straight html I use this code: <p style="page-break-after:...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
0
by: James | last post by:
We have a page that reads records from a database and displays them. Basically name/address/city/state/zip/county/phone. These records are between 4-6 lines a piece (there are other variables...
2
by: tomh | last post by:
I have a repeater which displays records from a database in table form. Each record is placed in its own table of about 3 columns and ten rows. This website is intended to be printed and prints out...
4
by: Rico | last post by:
Hello, I'm looking for a way to force a pagebreak in code. I'm having a tough time, the first page formats properly until the condition is met and then forces a new page. The problem is, every...
1
by: Daniele | last post by:
I have to create a report, that contains in the section body a list of record. For every record it has to appear an incremental additional field that begins from One; when he reaches the record...
1
by: tngoe | last post by:
I haven't programmed in Access for five years. The budget analyst asked me for help. Her report has page break after each group of organization. However, when posting this report on e-print...
1
by: cheyennemtnman | last post by:
In MS Access how can I skip to the next page on section break if section can not be printed entirely on the preceding page. Say if I had 20 print lines on the page and I have section 1 with 4...
1
by: kkshansid | last post by:
i hav a web page to display record of students in tabular form.to take print out its neccessary condition that whole record should come in one page not in separate pages is there any way to make page...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.