0

I'm creating an application where in I'm registering myself and saving details to users table as follows.

users(id, first, last, email, phone);

After that I wanna create many accounts under users like account1 and account2 as follows.

accounts(id, name, user_id);

Each account has its own purposes and does the functionality on behalf of signed user like CRUD.

Once user logged in, the user redirected to dashboard - that contains the no of accounts. So he can switch between these accounts.

Please help some suggestions regarding this. The work would be more appreciated.

Sanganabasu
  • 943
  • 7
  • 21
  • 39
  • Store account id in session . When ever switch the account change the session value then verify every time with account id . – vijaykumar Dec 02 '13 at 11:41
  • why 'accounts' why not the typical 'role' model? Is this supposed to act like 'wearing' someone else to see their view? Or just complex application of roles...? – Jakub Jan 03 '14 at 03:20

1 Answers1

0

You question is too "macro". Its better you start by modeling your database with relationships and so on.

Later you can come here and post some "micro" question. Because your "Switching between many accounts" envolves a lot of things that cant be solved just like that.