1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Storing logged in users (session) data in different database tables

Discussion in 'HTML & Website Design' started by Frenzyy, Nov 9, 2017.

  1. #1
    In short, I'm creating a stock portfolio website where users can track their investments. Different users can log onto the system but the problem I have is that they are all able to display the same information, as in the same portfolio of stocks. I have implemented sessions but due to not much experience with this, maybe I've done something wrong. I just simply want each user to have their own table in the database (or whatever way is best to do so) so that they can only view their investments when they log in. What's the best way of going about this?
    Thanks.
     
    Frenzyy, Nov 9, 2017 IP
  2. SpacePhoenix

    SpacePhoenix Well-Known Member

    Messages:
    196
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    155
    #2
    What server-side language is being used?
     
    SpacePhoenix, Nov 9, 2017 IP
  3. Frenzyy

    Frenzyy Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    PHP. I was looking around other forums and noticed that instead of tables, I maybe should use foreign keys and link stocks to users that way...
     
    Frenzyy, Nov 9, 2017 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #4
    They don't have their own table, work through some basic tutorials for things like guest books and see how tables are joined. Once you understand that you'll see how to keep people's investment info separate.
     
    sarahk, Nov 9, 2017 IP
  5. Frenzyy

    Frenzyy Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Thanks for your help, will try this and let you know if I have any issues! :)
     
    Frenzyy, Nov 9, 2017 IP