Hi everyone,
I am working with a couple of tables and am having trouble printing out the right results on my asp page.
This is what i'm trying to do:
I am working on a newsletter app. and have a form with muliple select checkboxes for the user to subscribe to a list. This checkbox form is populated from a database, where the input name and value is "newsletterID", which is coming from a table with an "newsletterID" column as well as an "newslettername" column.
when this form information is passed to the processing page, I want to print out the "newslettername" of the newsletters that the person has subscribed to, rather than the "newsletterID" that is the value in the checkboxes.
i have split the checkbox string into an array then put an SQL statement in a "for each loop", in the following way:
Dim objRS5, strSQL5, icount2
set objRS5 = server.CreateObject("ADODB.Recordset"
for each icount2 in split_news 'split_news is the array of newsletterID that the user has subscribed to
strSQL5 = "SELECT * FROM artistnames WHERE artistnameID = " & icount2 & ";"
next
objRS5.open strSQL5, objConn
for each icount2 in split_news
do while not objRS5.EOF
response.write objRS5("artistname"
objRS5.MoveNext
loop
next
when i do this, i am only getting the last "newslettername" rather than all of them. does anyone know how i can fix this? what am i doing wrong here?
thanks all, i really appreciate it!!
karren
I am working with a couple of tables and am having trouble printing out the right results on my asp page.
This is what i'm trying to do:
I am working on a newsletter app. and have a form with muliple select checkboxes for the user to subscribe to a list. This checkbox form is populated from a database, where the input name and value is "newsletterID", which is coming from a table with an "newsletterID" column as well as an "newslettername" column.
when this form information is passed to the processing page, I want to print out the "newslettername" of the newsletters that the person has subscribed to, rather than the "newsletterID" that is the value in the checkboxes.
i have split the checkbox string into an array then put an SQL statement in a "for each loop", in the following way:
Dim objRS5, strSQL5, icount2
set objRS5 = server.CreateObject("ADODB.Recordset"
for each icount2 in split_news 'split_news is the array of newsletterID that the user has subscribed to
strSQL5 = "SELECT * FROM artistnames WHERE artistnameID = " & icount2 & ";"
next
objRS5.open strSQL5, objConn
for each icount2 in split_news
do while not objRS5.EOF
response.write objRS5("artistname"
objRS5.MoveNext
loop
next
when i do this, i am only getting the last "newslettername" rather than all of them. does anyone know how i can fix this? what am i doing wrong here?
thanks all, i really appreciate it!!
karren