mysql - php flash highscore system for a games site -
I am currently working on a php / flash / mysql based high-score system for a website. The main purpose of this system is to score scores in the database using flash games. Whenever the user creates points, it will appear in the database. When I submit scores from the Flash file, the database is accumulating in the score.
Note: Registered in this system and both guests of the guest can submit their scores. Case 1: If the registered user collects points, then it will be credited to the database if the user is not already logged in but he is not a registered user and has created a highest score and depositing scores. After this I want to submit my score to the database. Here's how I can get it. Case 2: How can I get it if the user is not a registered user and wants to submit as a registered user.
I'm thinking that if you got 2 different tables and I'm sure this is an ideal way No, but I think this is the trick:
User: user_id, session_id, username, etc. Score: score_id, user_id, score, etc.,
When you are about to save the score, you create a user row and save the session_id () in the column session_id, so now you have received a reference to return to that current user).
If they register after saving the scores, then get user_id based on current_ession_id and update the real estate fields that they have entered.
If they log in after saving the score, then get the id of the line on which its session (in the context of their comment is not registered with iv). Obtain the dependent user's ID (in this comment ive it is called login_in_ar_id).
Now in the score of the table, the update score sets user_id = log in_user_id, where user_id = unregistered_user_id So we know that this digit is logged in user and this is in their history or anytime.
Then delete the row from the users where it was temporary: Remove from user where user_id = unregistered_user_id
// optimize tables, so everything is indexed, etc., etc.
Comments
Post a Comment