Jump to content

UmiSal

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

UmiSal's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How do you get the server's full URL from within a PHP script? By the "server" I mean the one running the script.
  2. The thing is, I am not speaking about any OO design, my problem is a strictly database problem. Sorry if I didn't make that clear. Even though I am using OO PHP to manipulate the database data, there are no classes corresponding to any entities that I mentioned. Basically, what I'm trying to do is to have a table obtain another table's attributes/involvement in relationships, and then add new specialized attributes/involvement in relationships to the ones it obtained from the parent table.
  3. How can you implement an "is-a" relationship in MySQL? For example: a Car [i]is-a[/i] Vehicle, i.e. it has all of Vehicle's attributes (e.g. id) and is part of every relationship that Vehicle is part of (e.g. [i]Moves-to[/i]), plus new attributes and execlusive relationships of its own. I want to know this because I am trying to implement a hierarchial user privileges system that looks something like this: [list][*]a [b]Coordinator [i]is-a[/i] Member[/b] but with more privileges[*]a [b]Manager [i]is-a[/i] Coordinator[/b] but with more privileges[*]an [b]Admin [i]is-a[/i] Member[/b] but with more privileges[/list] Where bold words are entities, and italic words are relationships. How can I implement this in MySQL? Is there a direct way to do it? Generally in this database design, each child entity (i.e. Coordinator, Admin and Manager) doesn't offer much new attributes (aside from the ones it inherits from its parent), but each one of them is involved in some execlusive relationships. Should I substitute the Coordinator, Manager and Admin entities with an attribute in the Member table indicating privileges mode (for e.g. members with "mode" value = "admin" are actually admins)? This will cause the Member entity to be involved in ALL the relationships that would otherwise be a child entity execlusive (e.g. Coordinator [i]Coordinates[/i] Area will now become Member [i]Coordinates[/i] Area). Should I rely on PHP to enforce only Members with certain "mode" value to participate in the otherwise exclusive relationships? Please Help! I'm desperate :(
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.