Jump to content

PHP Help. Injury: Store Time


tebrown

Recommended Posts

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

Link to comment
Share on other sites

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?

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.