I am only just learning PHP and I can grasp the concepts pretty well, but as I haven't done any programming since I was 10 (IF THEN GOTO...) I am struggling to fill in the gaps.
I have one table that lists all of my products and a url link to their photo.
I have another table that lists all of the products and 3 related products by their ID
1 Product 1 Url1
2 Product 2 Url 2
3 Product 3 Url3
1 Product 1 1 4 5
2 Product 2 4 2 8
I want to relate the two tables so I can pull out the 3 url links to each product.
In real world terms, I'm selling a skirt, when that is selected I want to display next to it 3 pictures of products related to the skirt that someone might like.
I was thinking along the lines of
Select ID Product URL
FROM Table1, Table2
Repeating 3 times for each related product.
That works fine, but how do I link it to the product that was originally selected? Normally it would be a WHERE statement for ID = 'colname' but I can't figure out how to add it in....
I'm sure this sounds confusing but if someone could point me in the right direction or to a tutorial/php site that discusses more advanced topics that would be great!!
Thanks a bunch!