Hi John,

Thanks for taking the time to respond.

What am I trying to do?

Well...I am trying to build a mailing list of previous customers WHO
purchased product_id 1 but not product_id 14.

I have the product items (id's) stored in the CartTable and I have
customer info stored in the OrderTable.

Using the same column of cart_id in both CartTable and OrderTable I am
able to reference which cart items (id's) belong to each record in the

What I did originally (that didn't work) was to select all records in
the CartTable that matched product_id=1 and product_id!=14 then I used
that information to reference against the OrderTable to grab the
customer information I needed.

The problem with my logic is that I did not take into account those who
purchased one of the product_id's on ONE purchase and then came back the
next day, week, year, etc and made another purchase for the other
product_id which.

I NEED to make sure that a customer HAS purchased product_id=1 and NOT
product_id=14 at ANY time, regardless of a single or multiple orders.

Does this make any sense? *sigh*

Thanks again.


> -----Original Message-----
> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: November 20, 2003 4:34 PM
> To: Aaron Wolski; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Unsure of how to perform query and results..
> From: "Aaron Wolski" <[EMAIL PROTECTED]>
> > I have data in a Db that looks something like:
> >
> > 14,[EMAIL PROTECTED],Andrew,Smith
> > 1,[EMAIL PROTECTED],Andrew,Smith
> > 14,[EMAIL PROTECTED],Barbara,Richardson
> > 1,[EMAIL PROTECTED],Barbara,Richardson
> >
> > The number represents a product_id that was purchased by the
customer in
> > question. As you can see from this example.. I have a two customers
> > purchased two different products.
> >
> > What I NEED to do is have one entry for each customer but with both
> > their product_id in the same result. For example:
> >
> > 14,1,[EMAIL PROTECTED],Andrew,Smith
> >
> > ANY clue how I could go about getting this to work? I'm very
> > and running out of time :-(
> Sorry, it's not going to happen and besides, there isn't any reason
> should need to return a row like that. How about you tell us what
> actually trying to do and someone can help you clean up your method...
> ---John Holmes...
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

Reply via email to