the layout of retrieved data

S

Shukie

The link for the photos are requested from the server and so the photo
appears on screen. I can produce a long list by using the response.write ***
& "<br>" or whatever. but is it possible to have it start on the next line
after say 5 photos in a line. i.e. where each - is a photo

- - - - -
- - - - -
- - - - -

rather then
- - - - - - - - - - - - - -
or
-
-
-
-
etc.

thanks
Shukie (apologies for the poor ascii pics)
 
S

Shukie

looking at http://www.asp101.com/samples/index.asp page, could i do this:

---------------------------------------------------

<table border="1">
<%
Do While Not rstSimple.EOF
%>
<tr>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>
 
R

Ray at

This would create four duplicate images per row.

<img1> <img1> <img1> <img1>
<img2> <img2> <img2> <img2>

as opposed to

<img1> <img2> <img3> <img4>
<img5> <img6> <img7> <img8>

Ray at work
 
J

Jeff Cochran

looking at http://www.asp101.com/samples/index.asp page, could i do this:

---------------------------------------------------

<table border="1">
<%
Do While Not rstSimple.EOF
%>
<tr>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
<td><%= rstSimple.Fields("filepath").Value %></td>
</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>

-----------------------------------------------------

Not if you don't want duplicated images. :)

Your code gets a value, rstSimple.Fields("filepath").Value, then
displays it in a cell in a table. It then creates a new cell, with
the exact same data since until you hit the rstSimple.MoveNext it
doesn't get the next value from your record set. So in effect, you
read the next value for the record set only when you create the next
row.

It's a logic error, you need a FOR/NEXT loop to retrieve the next item
in your recordset for each cell, not at each row. More like:

<tr>
FOR i = 1 to 4
<td><%= rstSimple.Fields("filepath").Value %></td>
rstSimple.MoveNext
NEXT
</tr>

Or actually, more like the sample code Ray told you to look at in the
first place... :)

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top