shaddf Posted March 22, 2017 Share Posted March 22, 2017 (edited) 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 March 22, 2017 by shaddf Quote Link to comment https://forums.phpfreaks.com/topic/303517-setting-results/ Share on other sites More sharing options...
requinix Posted March 23, 2017 Share Posted March 23, 2017 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). Quote Link to comment https://forums.phpfreaks.com/topic/303517-setting-results/#findComment-1544481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.