Current location: Hot Scripts Forums » Programming Languages » ASP » May be a stupid DB question? But please help!


May be a stupid DB question? But please help!

Reply
  #1 (permalink)  
Old 04-17-05, 08:40 AM
bowiec bowiec is offline
New Member
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
May be a stupid DB question? But please help!

Hi guys,

Just need some advice on a issue...

To understand what I'm doing:

I need to place images/colour samples for a fashion online site.. Now some of the gallerys have 10 or maybe 15 images.. now usually i would place a image holder for each image(let say 5).. and if the the db only had 4 images.. the 5th image would display a broken image icon? So my question is there away to avoid from it doing that.. or just another way of constructing the page..

Many thanks

Christian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-17-05, 09:35 AM
koncept
Guest
 
Posts: n/a
Post

yes there is, use an a few if statement in a do loop
what the code below will do is show all the items selected from a database, display them 5 per row and if there is no image to be shown it will display a blank box

Code:
  <tr>
   <%
   if not rs.eof then
    do while introwcnt <= 5
   if rs.eof then exit do
    if len(rs("image")) > 0 then
   %>
   <td><img src="<%=rs("image")%>" /></td>
   <% else %>
   <td>&nbsp;</td>
    end if
   
   introwcnt = introwcnt +1
   
   if introwcnt = 5 then
   response.write ("</tr><tr>")
   introwcnt=1
   end if
   
    loop
    else
    response.write("there are no records in this group")
    end if
  %>
   </tr>
that should do it, if you have any questions, i would be glad to help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DB entry thru php form question ajs PHP 3 03-21-05 10:07 AM
Posting a question / answer on site markcody PHP 2 11-23-04 02:58 PM
Stupid Question...maybe UVL PHP 4 04-28-04 10:25 AM
[PHP] Array question UmiSal Script Requests 1 04-05-04 02:52 PM
question and answer software jaydifox C/C++ 0 02-21-04 10:26 AM


All times are GMT -5. The time now is 12:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.