I was thinking using a table called relate_products, as follows:
id | product_id | related_prods
1 | 10012 | 10022
2 | 10012 | 10023
3 | 10045 | 10065
Then on when I'm on the product page I can do the followning:
SELECT * FROM `related_products` WHERE `product_id` = '$thisproductid';
while {
// SELECT infomation for current product from `products` table.
// Display Product Infomation
}
Then that would give me a list of related products I presume, but my question is is this the best way?
I have done things in the past and ended up creating a great deal of work by doing things the wrong way round.