One table, auto-increment for each user of your own?
It is better to write out the question on the example:
1. Need a table with orders (it is common for all users of the system)
id int(11) auto_increment - auto-increment for all orders
id_user_creator int(11) ID of the user who created the order (the same user can be user_creator and user_for)
id_user_for int(11) ID of user for whom this order (the same user can be user_creator and user_for)
2. And then that kind of logic, each user has two tabs (inbound and outbound), depending on whether he created the order or someone else has created
3. There he sees the numbering of the orders is not a common field (id), although it is also visible, but purely for communication between two users.
4. And we need another internal numbering to within the company not to operate a total order numbers (they can be very long and they sure will jump in numbering: 12, 345, 6578), and to work with their internal numbers (1, 2, 3)
and here plugging, the simplest solution is for each user to have a table of orders where to write the common order is still here. I.e. 3 of the table: General orders, and with each additional order is entered one record in the table each participant to give them their internal numbers
and it is possible to solve within a single table or am I a dreamer?