I do have a table with two fields, customers_id1 and customers_id2. I'd like to select all those customers_id's, which are connected (if possible) without doing a loop in my php code.
In example I do have the following data in the table:
customers_id1 customers_id2
1 2
2 1
1 3
3 1
I am logging which customers also login to other customers accounts to keep record which customer records belong together. As you can see, customer 1 and 2 is directly connected, I am writing two entries for this (1->2 and 2->1). Then customer 1 also logs in to customer account nr. 3, which actually also _should_ connect customer 2 into the chain.
Can anybody follow me ?
btw: the practical use for this is to keep records of customers as said, we are using this information against them when looking for fraud. in fact the most people using fake credit cards to order, try to order more and more with different customer accounts once they got something shipped :/
Does anybody know how I can simply select all which are somehow connected ?
Thanks for your help,
Alex
In example I do have the following data in the table:
customers_id1 customers_id2
1 2
2 1
1 3
3 1
I am logging which customers also login to other customers accounts to keep record which customer records belong together. As you can see, customer 1 and 2 is directly connected, I am writing two entries for this (1->2 and 2->1). Then customer 1 also logs in to customer account nr. 3, which actually also _should_ connect customer 2 into the chain.
Can anybody follow me ?
btw: the practical use for this is to keep records of customers as said, we are using this information against them when looking for fraud. in fact the most people using fake credit cards to order, try to order more and more with different customer accounts once they got something shipped :/
Does anybody know how I can simply select all which are somehow connected ?
Thanks for your help,
Alex