Click to See Complete Forum and Search --> : Pulling Products from DB


akrashdi
04-15-2007, 01:04 PM
Hi,

I found this example from a shopping cart script, everything else works fine, but I'm unable to pull the records from the DB and attach to this example,

Original Example :

Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price

Select Case iItemID
Case 1
aParameters = Array("./images/shop_shirt.gif", "ASP 101 Shirt", "37.50")
Case 2
aParameters = Array("./images/shop_kite.gif", "ASP 101 Kite", "17.50")
Case 3
aParameters = Array("./images/shop_watch.gif", "ASP 101 Watch", "35.00")
Case 4
aParameters = Array("./images/shop_pen.gif", "ASP 101 Pen", "5.00")
End Select
GetItemParameters = aParameters
End Function

What I'm trying to do

Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price

Select Case iItemID

do while NOT ToysDesc.EOF

CaseNum = ToysDesc("product_imagePath").value
Case CaseNum
aParameters = Array(ToysDesc("product_imagePath").value, ToysDesc("product_description").value, ToysDesc("product_price").value)

ToysDesc.moveNext
Loop

End Select

Return array containing product info.

GetItemParameters = aParameters
End Function