tebrown Posted April 24, 2012 Share Posted April 24, 2012 Hey Guys, Im currently working on this sport management system where managers can control their team. At the moment im trying to add a feature where if a player is injured on your team, the manager can click an 'injury' button and say how long he will be injured for. Although, what i would like to do with this feature is when it's stored into the database i want to make it so that when his injury time runs out he will become available again (not injured). How would i go about doing this feature? Cheers Browny Quote Link to comment https://forums.phpfreaks.com/topic/261524-php-help-injury-store-time/ Share on other sites More sharing options...
cpd Posted April 24, 2012 Share Posted April 24, 2012 Insert an injury for the player in an injuries table including the unique identifier for the player which should reside in the players table (assuming you have one). Then you can create a case in your SQL statement with a join from the injuries table and generate a new column with 0/1 depending on whether the player is injured or not. Alternatively you can create multiple queries first selecting your players then testing if each player has an injury, this however is not an efficient method and involves RBAR. This is slightly dependant on where your trying to determine if a player is injured. Are you just trying to generate a list of available players? Does the record contain a description of the injury? Do you need the description? Quote Link to comment https://forums.phpfreaks.com/topic/261524-php-help-injury-store-time/#findComment-1340076 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.