jbtinker
Starting Member
6 Posts |
Posted - February 23 2005 : 17:52:22
|
Hi. I need to add a link on our shopthanks.asp page and was wondering if anybody could help me with some ASP? I need to generate a link that looks like this: somepage.html?courseID=100801,670481,327491 where the numbers are the catalogID's for all of the products whose catalogID ends in 1 in the current order. I am not very good with ASP, but know a little bit. So far I have added these lines to shopthanks.asp at line 130:
sql = "SELECT catalogID FROM oitems WHERE orderID = 81 AND catalogID like '%1' " Set rs = myconn.Execute(SQL) oleCodes=rs("catalogID") Response.Write ("a href='somepage.html?courseID='" & oleCodes & "'")
This has let me write out a link, with which I can link to one courseID but I need to be able to add extra catalogID's with comma's in the middle to link to more than one courseID. Is there a way in ASP that I can assign all of the productID's in an order to the one variable separated by commas? Any help would be greatly appreciated.
|
|
StevenWWinters
Starting Member
47 Posts |
Posted - February 24 2005 : 10:40:25
|
Not exactly sure what you're trying to do as your example link wouldn't work. For starters, it would have to be somepage.asp, not .html
But based on what you have written you could do something like this:
'======
Dim rs, SQL, bFirst
SQL= "SELECT catalogID FROM oitems WHERE orderID = 81 AND catalogID like '%1' "
Set rs = myconn.Execute(SQL)
Response.Write "a href='somepage.asp?courseID='"
bFirst = True
Do While NOT rs.Eof If bFirst = True Then bFirst = False Else Response.Write "," End If
Response.Write rs("catalogID") rs.MoveNext
Loop
'=====
sompage.asp would then have to be written to parse courseID=100801,670481,327491 and do whatever you are trying to accomplish with it.
|
|
|