Thanks, I agree about the data structure. It's generated from an SQL query with an IN () clause. The results have to be ordered in the order the user selected the items (using a web interface). I don't think there's a way to do that directly with an SQL ORDER BY clause. I will use the suggestions here for a lookup hash, thanks again.