Help with PHP
Author |
Message |
nickison99
|
Posted: Tue Aug 03, 2004 10:03 am Post subject: Help with PHP |
|
|
I have a chunk of code here that displays info from the db.
code: | echo "<table border=1><tr><td><b>ID</b></td><td><b>Division</b></td><td><b>Away</b></td><td><b>Home</b></td><td><b>Time/Date</b></td></tr>";
$scheddb = mysql_query("SELECT * FROM Schedule2005 ORDER BY TimeStamp ASC");
WHILE($sched = mysql_fetch_array($scheddb)) {
echo "<tr><td>$sched[Game_ID]</td><td>$sched[Division_ID]</td><td>$sched[Team_1]</td><td>$sched[Team_1]</td><td>";
print date("D M d, Y g:i a", $sched[TimeStamp]);
echo "</td></tr>";
}
echo "</tr></table>";
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 </td><td>)
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
Description: |
|
Filesize: |
21.46 KB |
Viewed: |
8741 Time(s) |
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
nickison99
|
Posted: Wed Aug 04, 2004 11:37 am Post subject: (No subject) |
|
|
Any ideas?
|
|
|
|
|
|
nickison99
|
Posted: Thu Aug 05, 2004 11:23 pm Post subject: (No subject) |
|
|
Nobody?
|
|
|
|
|
|
Dan
|
Posted: Sat Aug 07, 2004 1:59 am Post subject: (No subject) |
|
|
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
|
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
nickison99
|
Posted: Sat Aug 07, 2004 9:16 am Post subject: (No subject) |
|
|
I'll give it a try. THanks.
|
|
|
|
|
|
|
|