Hi,
I'm struggling with a pretty simple matter.. I'm moving from HTML to ASP completely and I have this free classifieds site, that shows ads as search results from a single database table. The problem is, that some field values can be empty (or null) as in the seller has a cellphone but not a land line number or the product has no photos.
Can I implement a code that firstly checks if a field has a value and then act on it? What I'm doing now is:
And so forth, to a total of 4 possible pictures (pic2, pic3 etc..) so I would have to check first if field pic2 has any data in it and only then move on to the picture displaying HTML. Can this be done with a simple IF..THEN logic? I hope my question makes clear what I'm trying to do, it was surprisingly hard to explain
-Jim
I'm struggling with a pretty simple matter.. I'm moving from HTML to ASP completely and I have this free classifieds site, that shows ads as search results from a single database table. The problem is, that some field values can be empty (or null) as in the seller has a cellphone but not a land line number or the product has no photos.
Can I implement a code that firstly checks if a field has a value and then act on it? What I'm doing now is:
Code:
<% objCmd.CommandText = "SELECT * " & _
"FROM ads ORDER BY date"
objRst.Open
While Not objRst.EOF%>
<a href="pics/<%Response.Write objRst("pic1")%>" target="_blank">
<img src="pics/t_<%Response.Write objRst("pic1thumbnail")%>" width="100" height="70" alt="" border="1"></a>
And so forth, to a total of 4 possible pictures (pic2, pic3 etc..) so I would have to check first if field pic2 has any data in it and only then move on to the picture displaying HTML. Can this be done with a simple IF..THEN logic? I hope my question makes clear what I'm trying to do, it was surprisingly hard to explain
-Jim