Greetings all,
I have four products that can be either version 1 or version 2. I will never know before hand which version they are. It is entered into the database by an intranet page.
I am trying to take these 4 products, sort them by their version and then I need to take a product and pair it with another product of the same version, but not itself.
EXAMPLE
product 1 v1
product 2 v2
product 3 v1
product 4 v1
array(product 1, product 3, product 4)
product 1 needs a random pairing from the array that is not itself.
The way the company has the database setup this can not be done in the query.
table has product1_name, product1_version, product2_name, product2_version and so on.
So I pull each product name and product version out of the database and put them in variables
Product1=product1_name
product1version=product1_version
I have hit a wall though on how best to go about this. other than re-doing the database table can anyone lend a hand?
Thanks for your time.