Hello, was wondering is I could get some opinions from some phpRunner users. I am designing a database for a client and having some problems with how it should be setup best for phpRunner. A friend of mine who also does databases (but knows nothing of phpRunner) suggested one layout for the tables, but it is giving me fits in phpRunner.
There will obviously, be many more fields in this database... it's just the initial who owns which record and can edit/create/delete what this is giving me issues.
The database is for a nationwide club. With clubhouses in various cities and members in each clubhouse.
There are three levels of access required.
superuser - can add/edit/delete clubhouses and/or members
clubhouse - can add/edit/delete members to his/her clubhouse / can view ALL members
member - can edit his/her profile / can only view THEIR profile
method A suggested by my database friend...
==== table_logins =====
id, email, password (using the id field as the username for login so we don't have to keep making up silly usernames)
==== table_clubhouses =====
id, login_ID, name, location
==== table_members =====
id, clubhouse_ID, firstname, lastname
(( he told me to put all login info - even the members - in the logins table... but, I don't see how to do this in phpRunner since a clubhouse creating a new member doesn't have reverse access to create data in the logins table ))
method B that I keep coming back to...
==== table_clubhouses =====
id, email, password, clubhouse_name
==== table_members =====
id, clubhouse_ID, firstname, lastname
(( In scenario B, I create a record in table_clubhouses that is for the superuser and give it admin access to all records. The only problem I have with this version is that I am using the ID as the login username AND the who has ownership of records SO when I login as superuser (id=1) and try to create a new clubhouse it tells me I cannot because id 1 is already used... I'm guessing I need to add a field called clubhouse_ID to table_clubhouses and have it auto-increment manually???? ))
I haven't even gotten to the point where the club member can login - yikes!
Is it better sometimes to do these as TWO phpRunner projects? I could put the username/password for the members in the table_members and build that system as another phpRunner project...