Jump to content

Recommended Posts

OK so just to open up, here's they key info regarding what Im working with:

 

  • MySQL ver. 5.0.81-community
  • Editing databae via phpMyAdmin online
  • Site and databases hosted via 000webhost

 

Ok guys Im needing some help with my table structure.

I currently have the following table:

 

Player_IDFnameLnamedobbat_stylebowl_stylebioimg

1TestPlayer12011-01-01Right-HandedOff-SpinThis is a test. This is a test.img

 

This will be used to identify a player in the team my website is for, used to create/edit their bio page but also other pages where the info is required.

 

What I now need is the best way of organising the following data into managable tables that can be edited via a form on a PHP system

(creating the form I am fine with, I just need structure guidance)

 

So the data I require databased is as follows

 

Single match stats - (site admin enters a date/season, opponent, run scores, bowling scores etc)

 

Season stats - something that takes the data from an entire season of matches and totals it up, maybe totals of all the data of the above table thats is entered as "2011 season" for example

 

Lifetime stats - obviously, total of all stats no matter which season added

 

Now that seems straight forward enough in the respect if I just wanted team totals I'd lay out 3 tables in the above fashion, but I also need the stats for each individual player for a full scorecard each match AND their bio page.

 

 

To kind of summarise all of the following data needs structuring into tables and I could really use the help on the most simple way to go about it in order to keep my coding relatively simple

 

MATCH

Date

Season

opponent

total runs scored

total wickects lost

overs face

runs against

wickets taken

overs bowled

 

player 1 - runs scores, how out, 4s, 6s

player 2 - runs scores, how out, 4s, 6s

player 3 - etc

 

player 1 - overs bowled, maidens, runs against, wickets taken

player 2 etc etc

 

SEASON

 

The same pieces of info from above, but in total for the season inputted

Both team total for "season 2011" but also every individuals totals

 

OVERALL/LIFTIME

 

Not so fussed about the teams liftime total, but definatly need individual players totals

 

 

 

 

Im sorry this is such a long winded affair, and Im sure the structure could be relatively simple, but I need a push in the right direction as Im just doubting myself on what will/wont work to achieve what Im looking for

 

I considered using an fkey to link to the already existing "player" table but I dont see an option for it in phpMyAdmin, maybe I missed it and someone can point me right, or maybe it doesnt exist?  :shrug:

Help on that point is also appreciated

 

 

 

 

Thanks for reading the epic little essay of a post guys

Heres hoping someone can guide me true  8)

Link to comment
https://forums.phpfreaks.com/topic/229238-help-with-table-structure-required/
Share on other sites

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.