Forums
This topic is locked
Need help with results based on access level
Posted 19 Jun 2003 14:53:02
1
has voted
19 Jun 2003 14:53:02 Rob Kirkwood posted:
I am a real rookie when it comes to writing sql commands so I am hoping someone will be able to help me out. What I am trying to do would best be compared to how a typical dating website works. I have two tables - One containing the info on male members and one containing the info on female members. Both the guys and the girls have the option of signing up for a free or paid membership. If a guy chooses a free membership, then he can view the details on the girl he is inquiring about but he cannot get her contact information unless she has a paid membership and vice versa. So in other words our two member types " a guy and a girl" would not be able to contact each other unless one of them has a paid membership.
On my results page, after a guy has read the details on a girl he clicks a link to bring him to the contact information page. I need the sql statement which will check first to see if the guy is a paid member and if not the sql statement then needs to check if the girl is a paid member. If that comes up negative then the guy will be given the opportunity to upgrade his membership so he will be able to contact this girl.
Presently on my contact information page I have two recordsets.
The first recordset coming from the guys table provides the userID and access level for the guy.
The second recordset coming from the girls table provides the contact information (a phone number and email address) plus a userID and access level for the girl.
For the guy to access the contact information his access level must be 5 (free membership access level is 3) If he doesn't have a 5 then the babysitter must have a access level of 4 (free membership access level is 2) to be able to get her contact info.
Guys table name is > GUYS
Field names are gUserID and gAccessLVL
Girls table name is > DOLLS
Field names are dUserID and dAccessLVL and dEmail and dPhone
What sql statement is needed to confirm
1) that the guy has the correct access level to get the contact information.
2) If he doesn't have the correct access level, the statement must see if the girl has the correct access level to allow him access to her contact information.
3) If neither has the correct access level ("paid membership"

Any help will be very much appreciated,
Thanks
Robert