0

okay so I'm developing this website for my capstone class, it's a ticket reservation system. I'm using phpmyadmin on wamp server. My question is, at any point of time many users will be on my website.

They register or login, and according to their status ( being a Director or Audience) they can reserve a number of seats. So suppose if 2 users are on my website, one as a director and the other as an audience. How can I know which user is which?

When they register, the status is stored in the database, but how can I know which user has which status that are both on my website?

Thanks

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
Sam Muouj
  • 1
  • 1
  • Add a groupfield in your database. Its that simple. – Realitätsverlust Nov 18 '13 at 09:23
  • Maybe your professor/teacher can offer some suggestions as well. I simply suggest that because he/she will have a more complete understanding of what you're trying to accomplish than what can be communicated in a few lines of a forum post. – Isaac Bennetch Nov 19 '13 at 14:11
  • As far as the PHP application is concerned, there is only one user. Sure there may be other users accessing your server and you database simultaneously, but never the same session. Your application deals with only this current user here. – Mr Lister Nov 19 '13 at 14:18
  • @user3004047 if you dont get any other better answer please do accept as answer :) – Rubyist Dec 23 '13 at 11:51

2 Answers2

0

From my assumption if both User has different user name and password from these information you can find login user status.

Sandesh
  • 349
  • 2
  • 8
0

I will suggest to create a mapping table of Roles with User.

For example, User, Role and UserRoleMapping Model.

User ( id, username, FirstName )
Role ( id, role )
UserRoleMapping ( user_id, role_id, status )

Here when User makes an registeration, then as per its role create an entry in UserRoleMapping Table.

Then use of the view to display the list of UserRoleMapping, use their id to display their name and role. Make use of filter in tabs for different role by ordering with respect to created datetime.

To make more advance, you can also display the number of success login, login failure, latest login etc.

Rubyist
  • 6,486
  • 10
  • 51
  • 86