Jump to content

Recommended Posts

I am working on one of my sports websites and we are growing at a fast pace.  We have 40 division with 7-8 teams within each division.  I am not sure how to start what I vision, so assistance is greatly appreciated.

 

My schedule table (from this past season) is structured as follows:

CREATE TABLE `s2007schedules` (
  `game_no` text NOT NULL,
  `status` text NOT NULL,
  `division` text NOT NULL,
  `gameid` text NOT NULL,
  `date` text NOT NULL,
  `time` text NOT NULL,
  `home` text NOT NULL,
  `h_score` text NOT NULL,
  `visitor` text NOT NULL,
  `v_score` text NOT NULL,
  `field` text NOT NULL,
  `field_no` text NOT NULL,

 

I am envision is to have a drop down menu to select "Division".  Once selected, another drop down menu would display the teams within that specific division.

 

Now, I have half-assed the schedule from last season, so my table most likely needs modification to fit my vision.

 

Do I need to create table to correspond with the "Divisions", and another table to correspond with the "teams" of those "Divisions" for the drop downs and how would I program those?

 

Then, How do I code the drop downs to work with my query?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/55196-team-specific-sports-schedules-display/
Share on other sites

First off, why are all the fields in your "s2007schedules" table set as TEXT? TEXT is for huge amounts of text. "game_no" I would assume just holds a number....so it should be an INT type.

 

For the drop-down lists, you are going to need JavaScript and maybe some AJAX....that is if you want it to self-populate the drop-down without a page reload.

Like I said, I half assed the schedule table.  Last season, the game_id became numbers only, so yes it should be int.  Before that it included a couple letters.

 

What is ajax?  Or, how would I use javascripts for this project.

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.