JohannIcon
Programmer
Dear All,
I have a table with a number of fields and in one of them, I can store an image.
What I want is if this field does not have any entries, ie it is blank, then I display a common image, whereas if the user enters an image name, I display that image.
At the moment I am doing this:-
'*** Create a recordset to retreive all the editorials from the database
Set rs=Server.CreateObject("ADODB.Recordset"
rs.ActiveConnection = dbcon
sql= "SELECT * FROM Editorjal WHERE EditorjalID =" & id
rs.Open (sql)
image = rs("editorjalPic"
<%
if image="" then
response.Write("blank"
%>
<img src="images/editorjal/editorjal_writing.jpg" width="175" height="175" align="right">
<%
else
response.Write("not blank"
%>
<img src="images/editorjal/<%=image%>" width="175" height="175" align="right">
<%
end if
%>
However, the response.write is always "not blank" even if there is no image name in the field.
How can i go around this?
Thanks for your help
I have a table with a number of fields and in one of them, I can store an image.
What I want is if this field does not have any entries, ie it is blank, then I display a common image, whereas if the user enters an image name, I display that image.
At the moment I am doing this:-
'*** Create a recordset to retreive all the editorials from the database
Set rs=Server.CreateObject("ADODB.Recordset"
rs.ActiveConnection = dbcon
sql= "SELECT * FROM Editorjal WHERE EditorjalID =" & id
rs.Open (sql)
image = rs("editorjalPic"
<%
if image="" then
response.Write("blank"
%>
<img src="images/editorjal/editorjal_writing.jpg" width="175" height="175" align="right">
<%
else
response.Write("not blank"
%>
<img src="images/editorjal/<%=image%>" width="175" height="175" align="right">
<%
end if
%>
However, the response.write is always "not blank" even if there is no image name in the field.
How can i go around this?
Thanks for your help