You'll probably have to work your logic backwards. Prepare an array of images and product IDs. Then do your matching from the other angle.
Either that or you'll have to find a way to do a progressively-less-restrictive lookup, since the "LIKE" clause can't match on less than what you give it ... and as you know, the additional-image files are longer than the original product image base filename, and are of varying lengths.



) odd reply:

