Multiple rows

Results 1 to 3 of 3

Thread: Multiple rows

  1. #1
    Mark Smith Guest

    Default Multiple rows

    Say I had two tables (Table 1 and Table 2).<BR><BR>Table 1 has fields: UserID, Name<BR>Table 1 has fields: NoteID, Note, UserID (ie to link it to Table1)<BR><BR>I run my select query and get all the details from both table where user = whatever.<BR><BR>On my ASP page I want to display these results. I did this by using session("UserID")=rsdatabase("Table1.UserID"). And so for the other fields.<BR><BR>Now if a user has more than one note attached to him/her how to I display these? See session("NoteID") will only be the first note that it finds.<BR><BR>I want it to end up like:<BR><BR>User = ....<BR><BR>NoteID = 1<BR>Note = .....<BR><BR>and if there are any more notes it carries on...<BR><BR>NoteID = 2<BR>Note = ....<BR><BR>NoteID = 3<BR>Note = ......<BR><BR>etc...<BR><BR>Can anyone help?<BR>

  2. #2
    Tim Snyder Guest

    Default RE: Multiple rows

    I assume you are getting a recordset from the Database ok.<BR>&#060;table&#062;<BR>DO WHILE NOT rsTable2.EOF<BR> Response.write("&#060;td&#062;NoteID = " & rsTable2("NoteID")&#060;/td&#062;")<BR> Response.write("&#060;td&#062;Note = " & rsTable2("Note")&#060;/td&#062;")<BR>rsTable2.MoveNext <BR>LOOP<BR>rsTable2.Close<BR>Set rsTable2 = nothing<BR>response.write"&#060;/table&#062;"<BR><BR><BR>

  3. #3
    Mark Smith Guest

    Default RE: Multiple rows

    Thanks I&#039;ll give that a try!<BR><BR>Oh and yes I am getting the recordset ok.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts