Forums
This topic is locked
Display picture from database, Help!!
Posted 06 Jul 2002 00:30:39
1
has voted
06 Jul 2002 00:30:39 Eddie Adamsociety posted:
I want to design page that display thumbnail pictures from the database.How can I make table build automatic match with the number of the pictures in database.
I would like to have fixed 6 column and if database is added more than 7 pictures. I want table add one more row. and same when the 13 th picture is added the table add new row.
please help!!
Replies
Replied 06 Jul 2002 01:07:43
06 Jul 2002 01:07:43 aegis kleais replied:
Coding this off the top of my head, but make a recordset called rs and do something similar to:
<%
totalThumbs = rs.Count
response.write("<table><tr>"
for x = 1 to totalThumbs
' set counter
i = 1
' detect if record exists before cell is made
while NOT rs.EOF or NOT rs.BOF
response.write("<td><a href=" & rs.Fields.Item("fldThumbLink"
.Value & "<img SRC=" & rs.Fields.Item("fldImageSRC"
.Value & "></a></td>"
i = i + 1
if i = 6 then
response.write("</tr><tr>"
i = 1
end if
rs.MoveNext()
wend
response.write("</tr></table>"
-------------------------
Ok, this was all guesswork, but you can see how I'm thinking. If you get an error, post it and I'll look into it further.
<%
totalThumbs = rs.Count
response.write("<table><tr>"

for x = 1 to totalThumbs
' set counter
i = 1
' detect if record exists before cell is made
while NOT rs.EOF or NOT rs.BOF
response.write("<td><a href=" & rs.Fields.Item("fldThumbLink"



i = i + 1
if i = 6 then
response.write("</tr><tr>"

i = 1
end if
rs.MoveNext()
wend
response.write("</tr></table>"

-------------------------
Ok, this was all guesswork, but you can see how I'm thinking. If you get an error, post it and I'll look into it further.
Replied 06 Jul 2002 01:44:05
06 Jul 2002 01:44:05 aegis kleais replied:
<%
totalThumbs = rs.Count
response.write("<table><tr>"
for x = 1 to totalThumbs
' set counter
i = 1
' detect if record exists before cell is made
while NOT rs.EOF or NOT rs.BOF
response.write("<td><a href=" & rs.Fields.Item("fldThumbLink"
.Value & "><img SRC=" & rs.Fields.Item("fldImageSRC"
.Value & "></a></td>"
i = i + 1
if i = 6 then
response.write("</tr><tr>"
i = 1
end if
rs.MoveNext()
wend
response.write("</tr></table>"
%>
Made some adjustments......
totalThumbs = rs.Count
response.write("<table><tr>"

for x = 1 to totalThumbs
' set counter
i = 1
' detect if record exists before cell is made
while NOT rs.EOF or NOT rs.BOF
response.write("<td><a href=" & rs.Fields.Item("fldThumbLink"



i = i + 1
if i = 6 then
response.write("</tr><tr>"

i = 1
end if
rs.MoveNext()
wend
response.write("</tr></table>"

%>
Made some adjustments......
Replied 06 Jul 2002 02:54:22
06 Jul 2002 02:54:22 Eddie Adamsociety replied:
How the make recordset call rs?
Replied 06 Jul 2002 02:55:07
06 Jul 2002 02:55:07 Eddie Adamsociety replied:
do they have extension to do this? I am not good at coding
Replied 06 Jul 2002 03:26:13
06 Jul 2002 03:26:13 Eddie Adamsociety replied:
How should I make recordset call rs?
I used Access 2000 and the table called tbCards
my image field called "image"
I used Access 2000 and the table called tbCards
my image field called "image"
Replied 06 Jul 2002 03:39:30
06 Jul 2002 03:39:30 aegis kleais replied:
You can make a recordset by setting up a server model in UD and then opening the DATA panel. Click + and select RECORDSET. The topmost input field is the NAME of the record set. you can call it what you want, I just suggested rs for simplicity.
The problem with webdev is that it is rather code intense at times. UD is a great tool, but it requires HTML, Javascript, CSS, and other knowledge of foundations Internet technologies for the end-user to be able to tie this all together.
There may be an extension; best to do a search at google.com or macromedia's dreamweaver exchange area.
I can't give you the code to create the recordset, cause each situation is gonna be different (server objects, connection strings or dsns, etc)
The problem with webdev is that it is rather code intense at times. UD is a great tool, but it requires HTML, Javascript, CSS, and other knowledge of foundations Internet technologies for the end-user to be able to tie this all together.
There may be an extension; best to do a search at google.com or macromedia's dreamweaver exchange area.
I can't give you the code to create the recordset, cause each situation is gonna be different (server objects, connection strings or dsns, etc)
Replied 06 Nov 2003 10:19:48
06 Nov 2003 10:19:48 Jared Sutherland replied:
Best extension to use for want you want is called Horizontal Looper. It will do exactly what you want, you can specify how many rows and columns to use from the recordset. Download it from Macromedia. <b></b>