Click to See Complete Forum and Search --> : Db Asp Scripting
numba_one
09-24-2003, 01:01 PM
I was wondering if i was to enter data into a database, then have it come out as an image? how could i do that. like for instance i know if i enter text this is what i put to retrieve it
<% Response.write rsUsers("STATUS") %>
How could i enter text into the database, like off.gif then have it come out as an image? what would be the code for that?
Ribeyed
09-24-2003, 06:37 PM
hi,
just let me help you with the concept here. There is nothing hidden regarding images and storing images for displaying dynamically on a page.
Lets say you have a folder on your web server called "images" and the virtual path is:
/images
this is where you store your images and if the images are being uploaded from a form you store them in the images folder.
The image name well file name is then stored as text in a field in the database. This is no different from normal text.
When you pull the text from your database you do something like this:
<%
sql = "SELECT * FROM tblTable "
set RS = DBConn.Execute(sql)
while not RS.EOF
theimage = RS("ImageName")
%>
<img src="/images/<%=theimage%>" >
<%
next
%>
Thats all there is to it.
Hope this helps