So, I have two tables, tblOwners and tblNonOwners. These tables are filled with users. I need a third table that keeps track of if any one user has 'seen' any other user from the other.

What I though is having a tblSeen that has three records, the userID who is using the app, and the profileID that the user has seen/not seen, and a boolean fldSeen as 0 or 1.

How would I populate these tables automatically? I could create records for each user that signs up, but how do I create a record for every single relationship?

1 Answer 1


Solved this after some clever googling.

The Query is

INSERT INTO tblSeen(UserID, ProfileId)
SELECT 'some_user', pmkID FROM tblOwners

This will create as many rows as it can and fill it out, so I just have to do this when the user goes to the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.