product suggestion based on user data

Posted by Enkay on Stack Overflow See other posts from Stack Overflow or by Enkay
Published on 2010-04-13T04:26:56Z Indexed on 2010/04/13 4:33 UTC
Read the original article Hit count: 379

Filed under:
|
|
|

I'm trying to add suggestions to product pages along the lines of : "Customers who purchased this item also purchased x and y".

The way the data is compiled right now is a mysql table with 3 rows.

 PRODUCT | CUSTOMER |QUANTITY 

Product is the product ID. Customer is the customer ID. Quantity is the number of time that product was bought by that customer.

For each product description page, the system needs to figure out which users bought that product, what other products those users bought, in what quantity and then return the 2 products that were bought the most by people who bought the current product.

Hopefully this makes sense and someone can point me in the right directions as to what the mysql query should look like.

Thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php