Re: [PHP] Referrals

2002-05-13 Thread Miguel Cruz

On Sun, 12 May 2002, Randum Ian wrote:
> When you select an item to look at, there is a section named:
> 
> 
> Customers who bought this item also bought:
> 
> blah link one - blah description
> blah link two - blah description
> 
> Click here for more blah
> 
> 
> 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




[PHP] Referrals

2002-05-13 Thread Randum Ian

Hi all,

I am in the middle of writing a website for affiliate programs on the web,
which one is the best and why kind of thing. I would like to be able to do
something similar to what Amazon do on their website but I am struggling to
work out how they do it so convincingly. Here is an example of what I mean:

When you select an item to look at, there is a section named:


Customers who bought this item also bought:

blah link one - blah description
blah link two - blah description

Click here for more blah


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?

Any help would be greatly appreciated, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php