I have a several mysql tables within a database with some sort of order like this:<BR><BR>Promotions table<BR>p_id, p_startdate, p_end date<BR><BR>PromotionsOptions <BR>po_id, p_id, o_id<BR><BR>PromotionsOptionsValues<BR>o_id, o_name, o_group<BR><BR>SO a promotion has lots of options in the options table who&#039;s values are listed in the optionsvalues table. <BR><BR>There are 3 groups the optionsvalues are listed in (promo_type, medium, elements)<BR><BR>i want to end up with a recordset which doesnt have loads of extra data (like an inner join would produce) but that contains something like this:<BR><BR>p_id = 1<BR>p_startdate=12/05/2004<BR>p_enddate=16/08/2006<BR>p_type = "OptionsValues.o_name1, PromotionsOptionsValues.o_name2, PromotionsOptionsValues.o_name3"<BR>p_medium = "PromotionsOptionsValues.o_name6, PromotionsOptionsValues.o_name8"<BR>p_elements = "PromotionsOptionsValues.o_name12, PromotionsOptionsValues.o_name39, PromotionsOptionsValues.o_name42"<BR><BR>I hope this makes sense, currently i produce 2 arrays with the information in that i need, but im not sure its ideal. I include my current functions:<BR><BR>[code language="VBScript"]<BR>.....<BR>Private Function GetPromotions()<BR>dim oRS<BR>set oRS = new recordsetreader<BR>oRS.SQL = "SELECT * FROM tblPromotions ORDER by promo_id ASC"<BR>oRS.ReadType =1<BR>pArrPromotions= oRS.Read()<BR>set oRS = NOTHING<BR>pNoPromos = ubound(pArrPromotions,2)+1<BR>response.Write("no promotions="&pNoPromos)<BR>call GetPromotiondetails()<BR><BR>end function<BR><BR>Private Function GetPromotiondetails()<BR>dim oRS<BR>set oRS = new recordsetreader<BR>sp = ", "<BR>tmpSQL = "SELECT tblPromosub.promo_id, tblgroupsoptionpromo.option_name, tblgroupsoptionpromo.option_group FROM tblPromosub INNER JOIN tblgroupsoptionpromo ON (tblPromosub.option_id = tblgroupsoptionpromo.option_id) where "<BR>for i = 0 to UBound(pArrPromotions,2)<BR>tmpSQL = tmpSQL & "promo_id=&#039;" & pArrPromotions(0,i) & "&#039;"<BR>if i &#060; UBound(pArrPromotions,2) Then tmpSQL = tmpSQL & " OR "<BR>Next<BR>tmpSQL = tmpSQL & " ORDER by tblPromosub.promo_id ASC, tblgroupsoptionpromo.option_id ASC"<BR>oRS.SQL =tmpSQL<BR>oRS.ReadType =1<BR>pArrPromoSub= oRS.Read()<BR>set oRS = NOTHING<BR>if ISArray(pArrPromoSub) then call sortPromotionDetails()<BR>end function<BR><BR>Private function sortPromotionDetails()<BR>dim tID, tPT, tPM, tEM, tOG, j<BR>redim pArrPromoAS(3,pNoPromos)<BR>tID = pArrPromoSub(0,0) <BR>tOG = pArrPromoSub(2,0) <BR>tON = pArrPromoSub(1,0)<BR>j=0<BR>for i = 0 to ubound(pArrPromoSub,2)<BR>if tID &#060;&#062; pArrPromoSub(0,i) then <BR>pArrPromoAS(0,j) = tID<BR>pArrPromoAS(1,j) = tPT<BR>pArrPromoAS(2,j) = tPM<BR>pArrPromoAS(3,j) = tEM<BR>tID = pArrPromoSub(0,i)<BR>tPT = ""<BR>tPM = ""<BR>tEM = ""<BR>j=j+1<BR>else<BR>select case pArrPromoSub(2,i)<BR> case "1": <BR> tPT = tPT &"<BR>"&pArrPromoSub(1,i)<BR> case "2":<BR> tPM = tPM &"<BR>"&pArrPromoSub(1,i)<BR> case "5":<BR> tEM = tEM &"<BR>"&pArrPromoSub(1,i)<BR>end select<BR>end if<BR>next<BR>end function .......<BR>[/code]<BR><BR><BR>Many thanks!!!