PDA

View Full Version : Photo Album script



rabbits2
11-21-2005, 02:27 PM
Photo Album script
http://www.dynamicdrive.com/dynamic.../photoalbum.htm


I am trying to use your script for photo album, I need some assistance with how to populate the array from my recordset named: rs_pics displayed below is the select query which creates the recordset and belwo that the array with the first part written correctly using the reocrdset, but I need to know how to create a moveNext until rs_pics.EOF in this? Thanks for the help.

SQLQuerymake= "SELECT * FROM tbl_products where product_label= '" & strproductlabel & "' AND product_type='" & strproducttype & "' AND department='" & strdepartment & "'"
set rs_pics=objconn.execute(SQLQuerymake)

var galleryarray=new Array()
galleryarray[0]=["<%=rs_pics("menufile")%>", "optional description", "productpicB.asp?product=<%=rs_pics("product_id")%>"]
galleryarray[1]=["images.jpg", "optional description", "optional url"]
galleryarray[2]=["image.jpg", "optional description", "optional url"]

rabbits2
11-22-2005, 01:02 PM
I have solved my problem and this is how:

"<%
dim counter
counter = 0
Do while not rs_pics.EOF
%>"
galleryarray[<%=counter%>] = ["<%=rs_pics("menufile")%>", "<%=rs_pics("product_name")%>", "optional url","<%=rs_pics("product_id")%>","<%=rs_pics("large_media_file_name")%>"]

"<% counter = counter + 1
rs_pics.moveNext
Loop
%>"