Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - IF a database picture field is empty
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

IF a database picture field is empty

 Post Reply Post Reply
Author
mikewatts View Drop Down
Newbie
Newbie


Joined: 07 July 2003
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikewatts Quote  Post ReplyReply Direct Link To This Post Topic: IF a database picture field is empty
    Posted: 13 November 2003 at 5:35am

I have a news page with text and images inputted into a field from a form.  the trouble is that when i leave the forms blank the page outputs the box with the red cross. (i should add that i want the option to put a max of 5 images on there but when i dont want to use all 5 it comes up with red cross box)

Ive tried this and it doesnt work:

if rsCommon("picURL2")= "" or IsNull(rsCommon("picURL2")) then
    Response.Write "not available"
   else
    response.write("<img align=""left"" CLASS=""IMAGEBORDER"" src=""" & rsCommon("picURL2") & """ border=""0"">")
   end if

when i do this: Response.Write(IsNull(strpicURL2)) it returns False

How do I get this to work?



Edited by mikewatts
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2003 at 12:46pm

<%
If NOT rsCommon("picURL2") = "" Then
    Response.Write("<img align=""left"" class=""IMAGEBORDER"" src=""" & rsCommon("picURL2")) & """ border=""0"">"
End If
%>

Back to Top
mikewatts View Drop Down
Newbie
Newbie


Joined: 07 July 2003
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikewatts Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2003 at 1:42pm

thanks for replying AnthraX

hmmm I actually solved it myself just now but i shall give this a go as less code!

I had to use trim which made it work ok.

thanks for helping a noob!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.