Hello I Found This
[QUOTE=sharapov]
I am retreaving my data from the MySQL database and display it inside HTML table. What I need to do is display every sixth row of the table on the new page (when user prints it). I know that it is possible with CSS if I do something like this: <tr style=”page-break-after: always;”> My problem is how can I make my code to insert this line (<tr style=”page-break-after: always;”>) every sixth row? I tried to do the following but it doesn’t really work correctly. Can anybody help?
[code]
. . .
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++) {
if($i%6==5){
echo”<tr style=”page-break-after: always;”>”; }
else {
echo” <tr>”; }
. . .
The [B]above
[code=php]
<?php
include(“conf.php”);
$connection = mysql_connect($server, $user, $pass);
mysql_select_db($db) or die (“Unable to select database!”);
$query = “SELECT * FROM users WHERE (status=’Active’)”;
$result = mysql_query($query) or die (“Error in query: $query. “.mysql_error());
$row = mysql_fetch_row($result);
$num_results = 19;
for ($i=0; $i <$num_results; $i++) {
if($i%5==4){
echo “next<br>”;
}
else {
echo “User:$row[3]>”;
}
}
mysql_free_result($result);
mysql_close($connection);
?>
im sure its easy for someone that knows what their doing, im just now trying to learn php…