Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

next/previous...image gallery???

Status
Not open for further replies.

matrix07

Programmer
Mar 21, 2002
41
CA
hi...I'm doing an image gallery...and I got my images the way I want them...but I would like to do a next/previous link where the next or previous set of images are loaded from the database. Thanks. Here is my code so far.


<%
dim rsImage
dim sql
dim counter
dim limit

sql = &quot;select * from tblImages&quot;

set rsImage = Server.CreateObject(&quot;Adodb.recordset&quot;)
rsImage.Open sql, objConn, adOpenDynamic, adLockReadOnly, adcmdText

limit = 3
counter = 1

do while not rsImage.EOF
if counter = 1 then
Response.Write &quot;<tr>&quot;
end if%>
<td width=&quot;15&quot;></td>
<td><a href=&quot;<%=rsImage(&quot;image_large&quot;)%>&quot; target=&quot;_blank&quot; onClick=&quot;openWin(<%=rsImage(&quot;image_large&quot;)%>)&quot;><img src=&quot;<%=rsImage(&quot;image_small&quot;)%>&quot;></a>
</td>
<%counter = counter + 1
if counter = limit then
Response.Write &quot;</tr>&quot;
counter = 1
end if
rsImage.MoveNext
loop
%>
 
Hi

I have covered this before. Have a look at

thread333-233415

which outlines what to do and

Thread248-230355

which is the &quot;long winded&quot; version. Go to the bottom parts of the thread. Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top