Jump to content

SMPoint

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SMPoint's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. When I saw include ("footer.php"); include ("header.php"); It totally clicked. I never thought to run the footer then the header right under. I was looking to run header and somewhere else to run footer. Thanks to both sasa and mrdamien for being that extra set of eyes. This helped tremendously.
  2. $sql = "SELECT * from XXX where start_search BETWEEN '$nowq_date' AND '$nowq5_date' ORDER BY start_search ASC"; $result = mysql_query($sql,$connection) or die("Invalid query: " . mysql_error()); if (mysql_num_rows ($result) == 0){ echo "blah"; } $group_date = 0; while ($row = mysql_fetch_array($result)) { $start = $row["start"]; $end = $row["end"]; $date = $row["date"]; if($group_date === 0){ $group_date = $date; } else if($date != $group_date){ $group_date = $date; include ("includes/header_pop_group.php"); } echo "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='3'> <TR> <TD WIDTH='25%' BACKGROUND='images/group-blue-02.gif' HEIGHT='15'><B>XXX</B></TD> <TD WIDTH='25%' BACKGROUND='images/group-blue-02.gif' HEIGHT='15'><B>ZZZ</B></TD> <TD WIDTH='25%' BACKGROUND='images/group-blue-02.gif' HEIGHT='15'><B>YYY</B></TD> </TR> <TR> <TD WIDTH='25%' VALIGN='TOP'>$date</TD> <TD WIDTH='25%' VALIGN='TOP'>$start</TD> <TD WIDTH='25%' VALIGN='TOP'>$end</TD> </TR></TABLE>"; include ("includes/footer_pop.php"); } The above code prints each result per day like this... 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data header wrapped 02/13/2009 data data footer wrapped 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data header wrapped 02/14/2009 data data footer wrapped 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data and I want it to go like this... header wrapped 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data 02/12/2009 data data footer wrapped header wrapped 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data 02/13/2009 data data footer wrapped header wrapped 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data 02/14/2009 data data footer wrapped
  3. It did not work so I just did the include in the same section as your modified code... if($date != $previous_date){ $previous_date = $date; include ("footer.php"); } changed to include ("footer.php"); and it includes the footer, but only the first result of each day is wrapped, not all of the data of each day. Does that help?
  4. Ok, well I thought I had it, but I do not. I was taking the premise of the code that mrdamien gave me and thought I could use it the same way. Instead of using it for spacing...<BR><BR>...I though I would throw in an include file that displays a top of a box and then I wanted to throw in a footer that would display the bottom of the box...wrap the results by day using some graphics. Here is the modified code... $sql = "SELECT * from XXX where start_search BETWEEN '$nowq_date' AND '$nowq5_date' ORDER BY start_search ASC"; $result = mysql_query($sql,$connection) or die("Invalid query: " . mysql_error()); $previous_date = 0; while ($row = mysql_fetch_array($result)) { $start = $row["start"]; $end = $row["end"]; $date = $row["date"]; if($previous_date === 0){ $previous_date = $date; }else if($date != $previous_date){ $previous_date = $date; include ("header.php"); } echo "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='4'><TR> <TD WIDTH='25%' NOWRAP>$date</TD> <TD WIDTH='20%'>$start</TD> <TD WIDTH='15%'>$end</TD> </TR></TABLE>"; } My question is, where do I put the code to properly wrap the footer data by date using an include file?
  5. Well, it worked out great. I am totally confused, but only because I did not know what "===" was. I thought it was a typo. I was unaware of indentity array operators. I have used all of the others thousands of times, but never seen those. Were those always around in older versions of PHP? Anyways, thanks a million!!
  6. Hello all, Kind of stumped and am looking for some guidance. I have data that I grab "mysql_fetch_array" and it displays the results as expected. One by one, the "job" displays with all of the data for that day. The problem is I would like to group the data by day on the page so if I run a query of more than 1 day, I can take the multiple day results and display them properly. I am unfamiliar with displaying grouped data in a single page. Can someone point me in the right dir? This might help.... $sql = "SELECT * from XXX where start_search BETWEEN '$nowq_date' AND '$nowq5_date' ORDER BY start_search ASC"; $result = mysql_query($sql,$connection) or die("Invalid query: " . mysql_error()); while ($row = mysql_fetch_array($result)) { $start = $row["start"]; $end = $row["end"]; $date = $row["date"]; echo "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='4'><TR> <TD WIDTH='25%' NOWRAP>$date</TD> <TD WIDTH='20%'>$start</TD> <TD WIDTH='15%'>$end</TD> </TR></TABLE>"; } This prints .... 02/12/2009 start1 end1 02/12/2009 start2 end2 02/12/2009 start3 end3 02/13/2009 start1 end1 02/13/2009 start2 end2 02/14/2009 start3 end3 But I want it to print ... 02/12/2009 start1 end1 02/12/2009 start2 end2 02/12/2009 start3 end3 SPACE HERE 02/13/2009 start1 end1 02/13/2009 start2 end2 SPACE HERE 02/14/2009 start3 end3
×
×
  • 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.