Jump to content

tables????


nec9716

Recommended Posts

ok that will do few days that i play with that and I can't understand or figure it out what are my real need????

 

I want to run a race pool web page

 

so I have

-pooler where they have to pick 3 drivers, chassis, engine

-driver

-race result

-qualify result

-score result for pooler

 

so now I know how to do my table , but where I'm stuck is what will be teh simple way to do it

presently my tables are set like this

 

pooler:

name,dirver1,driver2,driver3,chassis,engine

 

driver:

name,teamname,chassis,engine

 

race;

well here I jugg arround between :

location,pos1,pos2,pos3,pos4

or

location,pos

 

poolerscore:

name,score

 

maybe my biggest issue is because I don't know how to related my table between them ....

 

thank you

 

Link to comment
https://forums.phpfreaks.com/topic/97086-tables/
Share on other sites

Maybe ...

 

users:

id

username

password

email

firstname

lastname

etc.

 

picks:

id

userid

raceid

driver1

driver2

driver3

chassis

engine

 

drivers:

id

name

teamname

chassis

engine

 

races:

id

location

 

outcomes:

id

raceid

driverid

pos

 

scores:

userid

score

 

With this you can:

1. Associate all the information in the user table with the picks and scores.

2. Associate the picks with the driver info.

3. Associate the results with driver info and the races.

 

There may be some inaccuracies with that layout because I just typed it out here. I didn't try to set it up or anything. At the very least, someone better at this will be able to help more and/or this will help you think about it and get you going in the right direction. When I started forming tables I was taught that you don't want any repeated data across multiple tables. That way you would just save an id of a row somewhere rather than having to save that literal text in multiple places.

Link to comment
https://forums.phpfreaks.com/topic/97086-tables/#findComment-496791
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.