2 Replies - 369 Views - Last Post: 09 November 2017 - 03:21 PM Rate Topic: -----

#1 Yhym  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-December 13

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

Posted 09 November 2017 - 04:03 AM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Storing logged in users (session) data in different database tables

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4136
  • View blog
  • Posts: 13,056
  • Joined: 08-June 10

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

Posted 09 November 2017 - 04:24 AM

Quote

I just simply want each user to have their own table in the database


No, you don't.

Quote

What's the best way of going about this?


give each investment entry a foreign key reference to the appropriate user. then you can select all investments only for that user.
Was This Post Helpful? 1
  • +
  • -

#3 Yhym  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-December 13

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

Posted 09 November 2017 - 03:21 PM

Thanks for your help, will try this and let you know if I have any issues! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1