Jump to content
Sign in to follow this  
shaddf

setting results

Recommended Posts

i have this table

 select MatchID,HomeScore,AwayScore from tbl_matches ;
+---------+-----------+-----------+
| MatchID | HomeScore | AwayScore |
+---------+-----------+-----------+
|      11 |         1 |         1 |
|      12 |         3 |         3 |
|      13 |         3 |         0 |
|      14 |         3 |         0 |
|      15 |         1 |         0 |
|      16 |         1 |         0 |
|      17 |         0 |         0 |
|      18 |         0 |         0 |
|      19 |         0 |         1 |
|      20 |         0 |         0 |
|      21 |         0 |         0 |
|      22 |         1 |         1 |
|      23 |         0 |         0 |
|      24 |         0 |         0 |
|      25 |         0 |         0 |
|      26 |         0 |         0 |
|      27 |         0 |         0 |
|      28 |         0 |         0 |
|      29 |         1 |         0 |
|      30 |         0 |         0 |
|      31 |         0 |         0 |
+---------+-----------+-----------+
21 rows in set (0.00 sec)

how can i set the unentered result .for now it is like all the games wether played or not are at 0:0.i need to be able to get  accurate table log of all the games such that if result is not set this can be identified and not set to 0:0. should i set the default to Null,or not null for the  HomeScore and awayscore?

Edited by shaddf

Share this post


Link to post
Share on other sites

NULL represents a lack of information. This would be a good time to use it.

 

In my opinion, you should have another means of knowing whether the match has been played - deciding that a match has been played should not depend on there being a score recorded. Perhaps a status ENUM (eg, "scheduled" vs. "played") or a played flag (false/0 vs. true/1).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.