Gossamer Forum
Home : General : Databases and SQL :

PHP/mySql Link to display a schedule in a table

Quote Reply
PHP/mySql Link to display a schedule in a table
Hello.
I'm trying to display a schedule of football games. There are 17 weeks and instead of displaying everything in one table, I would like to have a header with number 1-17 (weeks) and when someone clicks on a number it will display that weeks schedule in a table. Can someone help me with the code that is need to do this.
Thanks

Quote Reply
Re: [barryb12000] PHP/mySql Link to display a schedule in a table In reply to
May be a better approach would have a set of links for each of the weeks.

Week 1
Week 2

etc...

Then when someone clicks on the link, the HTML table is created based on parameter you set in the query string, like ?week=1.

You could also use IFRAME/ILAYER to dynamically print the HTML table of results rather than loading another web page.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] PHP/mySql Link to display a schedule in a table In reply to
My approach is to set links for each of the weeks, that's what I said in my question. I also said that I would like to have the data load in the same table dynamicallly. So your version of a different approch is the same as what I stated in my question.

So again can anyone help me with some example PHP code on how to do this?
Quote Reply
Re: [barryb12000] PHP/mySql Link to display a schedule in a table In reply to
Not sure exactly of the code, and I don't use PHP, but basically what you would probably want to do is have a column in your db called Week. For each game you enter, make sure week is filled in. Then you can do a select like SELECT distinct week from tablename and loop through the results printing your week links. As for the data loading dynamically in the table, not sure on that, IFRAME's may be one solution, DHTML may be another (I've seen some neet things with this using tabs to change the content on the page without it refreshing). HTH.