Jump to content

game results page


hyster

Recommended Posts

im stuck on a concept on how to do this and not the code (yet anyway lol).

 

i created a series of pages for recording results from a game i play.

i planned on using the date to group the results into gaming sessions.

works fine apart from that we play the game late at night so the dates are split by midnight (we start say at 23:00 and finish at 01:00)

so sorting by dates wont work.

 

then i thought about a game session id but how do i set the trigger to start a new session and finish it ???

if it was just me using it id just have a box to manualy input 1 but i have 6-7 diffrent people inputting the data so i need it pretty much idiot proof.

 

form/database options

id: // hiden - auto indexed

Clan:
Type:
Map:
Result:
Tier:
Date: 

Link to comment
https://forums.phpfreaks.com/topic/276325-game-results-page/
Share on other sites

It all depends on how you want it to work. Here's a thought off the top of my head.

 

1. Create a session table with a session_id (auto-increment, start_time (default current_timestamp) and end_time.

2. When a user access the page to input the data, get the last record from the session table.

If the session has an end_time, display output that there is no current session and give the user the option (button/link) to create a new session.

If the session is still active (no end time) then display the normal form to the user, but also display something like "Enter data for the current session started as mm/dd/yyyy hh:mm.". Then give the user the option to close the previous session.

Link to comment
https://forums.phpfreaks.com/topic/276325-game-results-page/#findComment-1421960
Share on other sites

so create a new temp table.

create start session button to "clean" table (or just close the previous session when finish button used?).

 

use the temp table to store the "current gaming session".

 

when finished for the day close the "current gaming session" with a button to move data to the result table.

 

temp_table

session_id: // hiden - auto indexed

Clan:
Type:
Map:
Result:
Tier:
Date:

 

final_table

id: // hiden - auto indexed

session_id: // hiden - auto indexed

Clan:
Type:
Map:
Result:
Tier:
Date:

Link to comment
https://forums.phpfreaks.com/topic/276325-game-results-page/#findComment-1421980
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.