session variables

Discussion in 'Databases' started by xamd404, Feb 18, 2011.

  1. #1
    Hello everyone,

    Right now I have a system set up on a website that stores game data and displays it. So i have a game form, I put in the game info like "name of game: game 1", etc... the game is the stored in the database. What then happens is the game is set according to users. So im a user called xamd404 when i go to my games i can see this game that was set for me. The users name is set in the table by anyone with access to the database. So i access the database and in the empty username field of the game's table i add in the username, in this case xamd404.

    How im doing this is im using session variables on dreamweaver. So the games table contains a username field and that field gets filled with xamd404 and that allows the game to show up for that user only when the game record set is filtered by the username.

    What im trying to do is set games for more users though. So 2 or 3 users can see 1 game at a time on their games page.

    Any ideas?

    Thanks
     
    xamd404, Feb 18, 2011 IP
  2. FriendSwapMeet.com

    FriendSwapMeet.com Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    make a session such as

    session = "game3636"

    and when the game is finished set the session to 0 then check if

    a session equals 0 is allows to send to a new game

    else sends them back
     
    FriendSwapMeet.com, Feb 21, 2011 IP
  3. prptl709

    prptl709 Guest

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Please give some example about session variables ie. how to write code for that and how to maintain session.
     
    prptl709, Feb 21, 2011 IP
  4. ACME Squares

    ACME Squares Peon

    Messages:
    98
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What type of code does Dreamweaver actually generate?
    Whatever language it is, can't you encapsulate the game state in an object and store that as a session variable?
     
    ACME Squares, Feb 23, 2011 IP
  5. linkbooster

    linkbooster Banned

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Firstly you have to start session session_start();
    and create variable and store in session.
     
    linkbooster, Mar 29, 2011 IP