you star !
I managed to work out WHY it wasn't working, but not how to fix it.
(don't really understand how it worked with your data and not mine)
This new approach definitely works, i'll have a go at using this method with proper data.
I took a slightly different approach
i created a new associative array and populated it with the recordset productid's as keys and the productnames as values.
i was in the process of playing with some php array functions to compare the 2 arrays to get the result I need, but will use your method first.
thanks for persevering :-)