Clarification.

I'm using modular arithmetic on a table of recently viewed items.  My fields
are:

  user_id, pid0, pid1, pid2, pid3, pid4, inc

user_id is the user's unique identification.
pid* is the product's unique identification.
inc is a number, modulo 5, corresponding to
    the last pid column updated for this user.

So, when the user visits a page, I want to verify that they
don't currently have this product in their "recently viewed"
list.

To do so, I'd like to know if the product id is in any of pid0, pid1, pid2,
pid3, or pid4.  To accomplish this, I could use a simple OR statement.  But,
the information I really want is in which column that product id appears.
Using PHP, I can simply grab the key from the array returned by the query.
I was hoping MySQL offered this functionality; evidently, it does not.

Sincerely,
Jeremy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to