Seperate database records in divs?

Results 1 to 2 of 2

Thread: Seperate database records in divs?

  1. #1
    Join Date
    Dec 1969

    Default Seperate database records in divs?

    I am trying to create a page that can display 4 different records from a database, each one in a different div container, for a news page.<BR><BR>I have an access database containing news records - headline, news and date. Each record also has its own auto-numbered ID. <BR><BR>So far I have managed to get the asp page to display all of the records in a list by using: <BR><BR>recordset.movenext<BR>Loop<BR><BR>and I have managed to get just 1 displayed by using: <BR><BR>SQL = "SELECT * FROM tblNews WHERE ID=1" and changing the ID number. <BR><BR>But I can&#039;t seem to find a way to display each in a different div container on the same page. Can anyone help please? I think this is really obvious but I just can&#039;t see it!<BR><BR>Thanks.<BR>

  2. #2
    Join Date
    Dec 1969

    Default How is this any different...

    ...from displaying records in a &#060;TABLE&#062;, each in its own row???<BR><BR>&#060;%<BR>SQL = "SELECT * FROM tableNews"<BR>Set RS = Conn.Execute( SQL )<BR><BR>For dnum = 1 To 4<BR> If RS.EOF Then Exit For &#039; if there are fewer than 4 records in the RS<BR>%&#062;<BR> &#060;DIV ID="div&#060;%=dnum%&#062;"&#062;<BR> ... content of the div ...<BR> &#060;/DIV&#062;<BR>&#060;%<BR> RS.MoveNext<BR>Next<BR>%&#062;<BR><BR>

Posting Permissions

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