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

Trying to show/hide a region based on other DB content

Enthusiast ,
Nov 28, 2012 Nov 28, 2012

Copy link to clipboard

Copied

I am trying to get a date to show or hide based on the content of another date within the same record, but I don't know how to write the code for the bold compare bit of the show if, the bit after the !==

Here's the code I have:

        <?php if ($row_rs_events['fld_eventsEND']!=="$row_rs_events['fld_eventsSTART']"){ ?>

It's two dates for an events calendar list that I am building, and basically it works like this... IF I have a start date and an end date which are different (a multiple day event), then I want both dates to display, but if the start and end date are the same (a single day event), then I only want to show the start date.

Multiple days event:

From December 10, 2012 to December 15, 2012.

Single day event:

On December 10, 2012

Can you please advise?

Thanks.

TOPICS
Server side applications

Views

452
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 ,
Nov 28, 2012 Nov 28, 2012

Copy link to clipboard

Copied

LATEST

looks correct to me, except for the extra double-quotes:

<?php if ($row_rs_events['fld_eventsEND']!==$row_rs_events['fld_eventsSTART']){ ?>

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