Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Show or hide a region based on content

Enthusiast ,
Sep 15, 2008 Sep 15, 2008

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

264
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 15, 2008 Sep 15, 2008

Copy link to clipboard

Copied

LATEST
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/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines