Jump to content

Database joins etc


Siggles

Recommended Posts

Hi,

 

I am creating a dbase that will allow the website I run to make predicitons on football games.

 

I have already created the users section and the tables which hold the games and the scores. I am now doing a seperate table for the predicitons from the users. I am trying to find out the best way to join the users tables and and the predicitions tables and also ways to get scores from the users predictions. In other words, results on the fly, or up to date tables/rankings for the users based on their predicitons.

 

Can anyone suggest a way to do this, maybe a tutorial on how to do table joins and how to display results(calculations from tables) on the fly?

 

Any help would be much appreciated.

 

Regards

 

Siggles

Link to comment
Share on other sites

These are the tables I have (amongst others)...

 

users

 

  username varchar(30)    - primary key       

  password varchar(32)             

  userid varchar(32) L               

  userlevel tinyint(1)         

  email varchar(50)             

  paidplayer smallint(6)           

  timestamp int(11) 

 

Fixtures

 

uniqueid - mediumint(8)    - Primary Key 

  gamenumber - char(2)           

  datecreated - date             

  datelastedited - datetime             

  dateplayed - datetime               

  opponent - varchar(20)             

  homeaway - varchar(5)               

  resultus - char(3)             

  resultthem - char(3)

 

Predicitions

 

  username - varchar(30)  - primary key (linking it to fixtures table)         

  uniqueid - mediumint(8)  - linking it to users table           

  prediction - char(1)             

  resultus - smallint(2)             

  resultthem - smallint(2)

 

Link to comment
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.