Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2011
    Location
    England
    Posts
    23
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Lightbulb users individual recent game name history

    Hi there,

    I wanted to make a page where logged in users can see the recent 10 flash games they played via my website (as in the page would show the names of the games)

    Is there some way this could be done so each individual user could have their own list of the recent 10 games they played?. Would this have to be stored in a database?. I'm not a genius with PHP (Im a student) and I'm creating my first website for testing really whilst I learn PHP and would hope to publish it in the future. But I have searched google and can not find any results as to my required needs.

    The website I am building is going to be a flash games based website, where users can play flash games free (much like Miniclip).

    Thanks for any contributions! Let me know if the question is too confusing!

    - Camzenxbt

  • #2
    New Coder
    Join Date
    Jan 2012
    Location
    Latvia
    Posts
    65
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Hello, I am a beginner aswell, but I can direct you a little to the right direction.

    You should create a Sql Table, witch would hold the user activity. And develop a simple PHP Code, witch executes a simple query to the table you created, when a logged in user enters the page of the game. Query could contain a simple information of the UserId, GamePlayed, and Time. So after this, you will be able to pull the statistics from the table about every recent user activity.

    This could be a very basic solution, but for a school work it could be ok.
    "Be formless... shapeless, like water. Now you put water into a cup, it becomes the cup. You pour water into a bottle; it becomes the bottle. You put water into a teapot; it becomes the teapot. Now water can flow, or creep or drip or crash! Be water, my friend..." by Bruce Lee

  • Users who have thanked WingTsun for this post:

    camzenxbt (08-25-2012)

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    A database is easily the best method, and just like WingTsun said, simple enough with only 3 database columns. Presumably, you already have a database setup, as you're talking about logged in users.

    If you don't wanna do it that way, a much messier way would be cookies. Store a cookie with a concatenated list of the last games played, and every time someone plays a game, add to that list; if the lists exceeds 10, drop the first one.

  • Users who have thanked Keleth for this post:

    camzenxbt (08-25-2012)

  • #4
    New Coder
    Join Date
    Aug 2011
    Location
    England
    Posts
    23
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Smile

    Thank you all for your help!. I shall start using this method now, I never thought of that!.

    - Camzenxbt


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •