i dont know how they do it, but it shouldn't be too hard.
I would go about doing it this way.
I would have a table that has a customer_id, a product_id, and a category_id. This table contains every product bought by every customer.
So let's see how this works....
Lets say you are lookin at a product whose ID is 22, and category ID is 12.
Basically you search the table for rows where product id is 22 and category id is 12 to get the customer ID. Now that you have the customer ID, let's say it's 342, you search the table for rows where the customer id is 342, and the category ID is 12. That way, you will know if they bought anything else in the same category.
Of course, if you come up with multiple customer IDs in that first query, you will have to loop your searches :-D.
This is just off the top of my head, I'm sure it can be improved, or there could be a better way!
----- Original Message -----
From: [EMAIL PROTECTED]
To: CF-Talk
Sent: Wednesday, May 19, 2004 2:12 AM
Subject: How does Amazon do that?
When you look around Amazon.com, and show an interest in something, there's
always a part of the page that says "people who bought this also bought that
.."
How do they do that?
Do they really build tables of related items dynamically from purchases? Or
do they have products categorised and just randomly pick products out of
categories similar to the one you're looking at?
Or do they do it another way? Or how do other online stores do this?
Reason for asking: I am building an on-line store, and think it would be
good to add this functionality if it's not too difficult.
Cheers
Mike Kear
AFP Webworks
Windsor, NSW, Australia
http://afpwebworks.com
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- How does Amazon do that? mkear
- Re: How does Amazon do that? Maureen
- RE: How does Amazon do that? brobborb
- RE: How does Amazon do that? Tim Blair
- RE: How does Amazon do that? Qasim Rasheed
- Re: How does Amazon do that? Tero Pikala
- Re: How does Amazon do that? Jeff Langevin