
-----------------------------------
nickison99
Tue Aug 03, 2004 10:03 am

Help with PHP
-----------------------------------
I have a chunk of code here that displays info from the db.
echo "IDDivisionAwayHomeTime/Date";

$scheddb = mysql_query("SELECT * FROM Schedule2005 ORDER BY TimeStamp ASC");
WHILE($sched = mysql_fetch_array($scheddb)) {

echo "$sched[Game_ID]$sched[Division_ID]$sched[Team_1]$sched[Team_1]";
print date("D M d, Y g:i a", $sched[TimeStamp]);
echo "";

  
}
echo "";
include ("bottom.tpl");
?>
When outputed it displays like the attachment 'Picture 1'. I need it to display like this:

Sat Apr 03, 2004
1 - Mite - Team 1 - Team 2 - 8:15 am 
2 - Mite - Team 3 - Team 4 - 8:15 am 

Sun Apr 04, 2004
6 - Novice - Team 3 - Team 4 - 5:00 am 
etc...

(the -'s are symbolic of )
Each time a new date comes around it shows the table again but with the new date and game info. Is this possible? If it is how can I change it? If more info is needed from me just ask.
Nick

-----------------------------------
nickison99
Wed Aug 04, 2004 11:37 am


-----------------------------------
Any ideas?

-----------------------------------
nickison99
Thu Aug 05, 2004 11:23 pm


-----------------------------------
Nobody?

-----------------------------------
Dan
Sat Aug 07, 2004 1:59 am


-----------------------------------
Could you not just add some ifs in the loop to dived the tables by day based on the date?

like:

lastDate = oldestDate

make a new table with lastdata

loop
     if thisRowsDate != lastDate then
         lastDate = thisRowsDate 
         make a new table with thisRowsDate
     end if
put data in table

end loop

-----------------------------------
nickison99
Sat Aug 07, 2004 9:16 am


-----------------------------------
I'll give it a try. THanks.
