Skip to main content
Inspiring
September 15, 2008
Question

Show or hide a region based on content

  • September 15, 2008
  • 1 reply
  • 287 views
What I want to do is show a region based on content from a field in a db record.

Show region if resortset is empty isn't what I want as the record isn't empty, it's just that part of the record is empty, so I want to show an image in its place.

I know how to do it in ASP, but not PHP. ASP is like this:

<%IF (recordset.Fields.Item("fld_image").Value) <> "none" Then%>
NOTHING TO SHOW
<%End IF%>

So, how do I do that with PHP?

Thanks

Mat
This topic has been closed for replies.

1 reply

Inspiring
September 15, 2008
matthew stuart wrote:
> <%IF (recordset.Fields.Item("fld_image").Value) <> "none" Then%>
> NOTHING TO SHOW
> <%End IF%>

The following code displays the output if the field actually contains
something. If it contains nothing, it's ignored.

if (!empty($row_recordsetName["fld_image"])) {
echo $row_recordsetName["fld_image"];
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/