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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query from DB then place image in table. 2

Status
Not open for further replies.

craiogram

MIS
Feb 20, 2004
126
US
Conn and Rec Sets are fine and pulling data.

What I need to do tho is when I query the DB if the field has a certain value let say "YES" I want to then put an image in the cell of my table. Any help would be greatly appreciated.
In this sample code Row 1 will give me the word "MATCH". When I get a match I'm trying to place an image like in Row 2(I'm sure there is something conceptually wrong):

<code>
<TABLE >
<TR><TD><%if (poolRS("Col1"))= "YES" then Response.Write("MATCH")%></TD><TD>Col2</TD></TR>
<TR><TD><%if (poolRS("Col1"))= "YES" then <img src="..\images\Sold1.bmp">%></TD</TR>
</TABLE>
</code>

Thank you in advance.
 
Hello,

Think you just need to come out of your vb code to display your html.

ooh, and an end if!!!

Code:
<TABLE>
<TR>
 <TD><% if (poolRS("Col1"))= "YES" then Response.Write("MATCH")%></TD>
 <TD>Col2</TD>
</TR>
<TR>
 <TD><% if (poolRS("Col1"))= "YES" then %>
  <img src="..\images\Sold1.bmp">
  <% end if %>
 </TD</TR>
</TABLE>


daveJam

*two wrongs don't make a right..... but three lefts do!!!!*
 
This should do you - you just need a Response.Write for the <img>
Code:
<TABLE>
<TR><TD><%if (poolRS("Col1"))= "YES" then Response.Write("MATCH")%></TD><TD>Col2</TD></TR>
<TR><TD><%if (poolRS("Col1"))= "YES" then Response.Write "<img src=""..\images\Sold1.bmp"">"%></TD</TR>
</TABLE>


Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top