Jump to content

Recommended Posts

Try this then....

[code]<?php
$groupheader = null;
while ($row = mysql_fetch_array($result)){
  $group = $row['main_group'];
  if (is_null($groupheader) || strcmp($groupheader, $group) != 0){
      $groupheader = $row['main_group'];
      echo "<br>\n{$row['main_group']}<br>\n";
  }
  echo "{$row['item_name']}<br>\n";
}
?>
[/code]

You'll possibly need to change your SQL query.

Regards
Huggie
Link to comment
https://forums.phpfreaks.com/topic/23563-display-group-of-data/#findComment-106972
Share on other sites

well the concept would be this

Can have a link or button to pass on the variable "printreport"

[code]<a href="<?=$_SERVER['PHP_SELF']?>?printreport=yes">Click here for entire report</a>[/code]

Then have this check on the page

[code]<?php
if(isset($_GET['printreport'])){
// query to select all records
$sql = "select * FROM table";
} else {
// query to select records by page
$sql = "SELECT * FROM table LIMIT x, x";
?>[/code]

Ray
Link to comment
https://forums.phpfreaks.com/topic/23563-display-group-of-data/#findComment-107035
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.