Print Page | Close Window

Displaying an image...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4588
Printed Date: 30 March 2026 at 10:06am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Displaying an image...
Posted By: l15aRd
Subject: Displaying an image...
Date Posted: 29 July 2003 at 6:55am

I want to display an image a number of times, depending on the number in a db field, i.e. display 2xImages if the field is 2.

anyone have any ideas?



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

http://www.drunkentechie.net - DrunkenTechie.net

You can logoff, but you can never leave



Replies:
Posted By: peterm
Date Posted: 29 July 2003 at 9:13am


'open database recordset stuff

For Counter = 1 to rsData("NumberofTimes")
  Response.Write "<img src=""filename.gif"">"
Next

?



Posted By: Flamewave
Date Posted: 29 July 2003 at 10:52am

you will want to cast the data from the recordset as a integer to make sure you get a number and not a string:

'open database recordset stuff
For Counter = 1 to Int(rsData("NumberofTimes"))
  Response.Write "<img src=""filename.gif"">"
Next



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: l15aRd
Date Posted: 30 July 2003 at 12:54am
Thanks guys that worked a treat :)

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

http://www.drunkentechie.net - DrunkenTechie.net

You can logoff, but you can never leave



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net