Relational Databases - How to Implement in PHP

When I first started programming for I wasn't aware or able to find out how anyone had implemented the "relations" part of a database as a data structure.

So I came up with my own method. Basically I have a giant two dimensional array -- relations[object-1][object-2] which contains information on whether or not a relationship is possible.

(I also created an array that stored whether or not the person who controlled object-1 had persmission to add or delete relations to object-2 -- this was necessary because of my somewhat unique permissions system.)

Now the problem I'm running into is that there are often two relations permissible between two objects -- relationships that I need to treat differently. For instance, I have groups as an object and they can be related to another group because they are 1) a parent group in a network, or 2) a child group in a network.

I've considered creating different objects - so a network could be different than a group, even though its fields are identical. However that doesn't seem to fix the sponsoring/participating in an event matter.

A similar thing occurs between groups and events - a group can participate in an event (only for Days of Action), or sponsor any event. These are two different types of relations and need to be treated as such.

As I failed to incorporate the need for multiple types of relations between the two same objects in my original design, my code is now riddled with exception handling (aka special cases).

I'm wondering if it would be better to create a new relationship structure like
$relations[object-1][object-2][1]->type (1-1, many to many, etc)
$relations[object-1][object-2][1]->add (permission to add)
$relations[object-1][object-2][1]->del (permission to delete)
$relations[object-1][object-2][1]->name (name of relationship - ex. participating group
$relations[object-1][object-2][1]->exists (whether a relationship is possible)

And the same thing would exist for a second relationship between the two objects

I could add additional fields for special instructions, like text to give the user for adding the relation (eg "Add a Network").

Does anyone have experience with this?

I'm hesistant to do a major structural change to my code.