Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying an image from a SQL db pathname

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
CA
Hi

I have a sql server with database called inventory. I created a table with columns ImageUrl <varchar> ProductName <char> Producttype <char>.

I filled one entry in the db and used as the value

What code can i use to display that image on my site along with it's associated product specs...
 
You could do something like this...

<%
'Assume you made connection to DB already
' and queried the DB for the Record Set
Response.Write &quot; <IMG SRC=&quot;&quot;&quot;& RecordSet(&quot;ImageURL&quot;)&&quot;> <BR>&quot;
Response.Write RecordSet(&quot;ProductName&quot;)&&quot; &quot;&Recordset(&quot;ProductType&quot;)&&quot;<BR><HR>&quot;


'Don't forget to loop this.....

%> _______________________________________________
OutsideIntranets.com
Stop wasting time, get to work
 
Thanx for the reply.

I managed to get it working with a similar command but without the Response Write?? (maybe because i am using dreamweaver mx?

<IMG src=&quot;<%=Recordset(&quot;ImageUrl&quot;)%>&quot; width=&quot;75&quot; height=&quot;75&quot;>


THank you!

 
= is the same a as response.write in ASP just a short version
so saying
&quot;<%=Recordset(&quot;ImageUrl&quot;)%>&quot;
is essentialy the same as saying
&quot;<%response.write Recordset(&quot;ImageUrl&quot;)%>&quot; _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
has you're questio
 
Learn something new everyday! I did NOT know that!
ie. (= the same as Response.Write)
Thanks guys
 
Yep, in fact if you force it to throw an error in that response.write, the 500 error will actually output the correct line but when it displays the line will display it with the Response.Write instead of an = sign. :)

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top