0

I'm currently working on a project which involves users connecting with each other. The users themselves don't choose who they connect with, they are automatically assigned to each other.

I have set up the user and admin profiles using PHP and mysql.

Could anyone help me with how to go about implementing this? I am not looking for someone to code this for me, I would just like some guidance on how I would do this as I am new to programming.

I have seen examples of how people add and delete each other as friends but this isn't what I am looking for.

I need an admin to be able to link a user from one list to a user from another. I then need them to appear on each others profiles as their connection.

I hope this makes sense. I can supply more information if needed.

PrincessP
  • 37
  • 4
  • 1
    How is this different from two users adding each other? You've instead got an admin making the connection instead of the end users doing it. – andrewsi Mar 03 '16 at 15:22
  • I'm just confused as to how would I implement this.. Maybe I am making it more complicated in my head then it is. Would I display two lists of users to the admin and then add a connect option when 2 users are selected? and add the ID of these two users to a connection table? – PrincessP Mar 03 '16 at 15:31
  • Could you add a diagram or a stronger example to assist? – Marcus D Mar 03 '16 at 16:31

1 Answers1

0

You could actually just approach this by making a class which holds the methods to connecting the users together. Allow the admin to select the two members then use a Database to store the connections between the users.

The admin can do this by using a simple Form and just querying the database for all current users and then POST it to a handler (class).

Your infastructure should look a little like this:

Class Connection
Method 1 - Creating the connection (include check if they are already connected)
Method 2 - Creating a connection platform or/and interface.

Initialization Class:
Method 1 - Maybe hold a unique connection key between each users that are connected that way, each user will just have matching keys.

Database Structure:
cid = connection ID - Primary key
connection1 = first user
connection2 = second user.

Jaquarh
  • 6,493
  • 7
  • 34
  • 86