There are 4 tables:

  • User
  • User_shipper
  • Info_user
  • Info_user_shipper

user table - list of users_1
Table user_shipper - list of user_shipper
Table info_user - information about info_user . Communication with user.
Table info_user_shipper - information about info_user_shipper . Communication with user_shipper.

You need to User_shipper and info_user_shipper with user and Info_user respectively.

But there is one snag. User Advertisements in one category. User_shipper to another.

Declarations are associated with the id_user and id_user_shipper with user and user_shipper . To understand who made the announcement.

So, how it is useless to transfer all this? Need an algorithm

  • left join to merge if the field may not be filled. nothing else of the question is clear what to transfer to itself. And the structure of the tables is strange. If their roles are so similar and you have to give references to one thing to another, then with a probability of 90% this is one and the same entity. Those. any users should be in one users table, just enter the "category" field to distinguish them from others - Mike
  • Draw on paper links - it will be clear where to put the join. Draw us with symbols | in the code link of the fields on the left, the names of the tables - and further in a row the list of their fields. User id field2 and so on. Or the same picture of connections - nick_n_a

0