hello
i have a table that receives entries from a shopping basket something like this

item1
item2
item3
price1
price2
price3
quantity1
quantity2
quantity3

Now when a user checks out, the values of his basket are inserted into the above table.

NOw after payment is verified, i want to be able to put the value each into a unique table, showing each[B] item he purchased.

PROBLEM

e.g. If there are 2 items in the shopping basket. then item3 and related tables woudl be empty

So i would want something like this
case items_purchased =
select count(item1), count(item2), count(item3) from inserted
for each item <> 0
insert into purchased_item (item, quantity, price)
values (item1, quantiy, price)

next

how do i achieve this correctly

TAKING NOTE, That the values inserted item1 would change for each loop. ie values (item1, quantity1, price1)

next
(item2, quantity2, price2)

etc...
for each non null value

thanks
Afrika