On Sun, 12 May 2002, Randum Ian wrote: > When you select an item to look at, there is a section named: > > <snip> > Customers who bought this item also bought: > > blah link one - blah description > blah link two - blah description > > Click here for more blah > <snip> > > How is this done? Is there a reference to a new db which has the links and > references them from there or do they look into sessions or cookies?
They can't look into cookies; other people's cookies aren't available on demand, but only when those people are actively surfing the site. They just look at their database. It's all about recording everything in as normalized a fashion as possible so you can keep coming up with new ways to draw connections from it. Make a table customer_purchase that gets updated whenever someone buys something: customer_id int; item_id int; Then, when you look at an item $xx and want to see what else was purchased by people who bought that item: select distinct item.name from item, customer_purchase cp1, customer_purchase cp2 where cp1.item_id=item.item_id and cp1.customer_id=cp2.customer_id and cp2.item_id=$xx Obviously their data structures are more complex and a mere glimpse of the schema would instantly gray the hairs of ordinary mortals such as you and me, but you get the idea. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php