Skip to main content
Inspiring
November 28, 2012
Frage

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

  • November 28, 2012
  • 1 Antwort
  • 476 Ansichten

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.

Dieses Thema wurde für Antworten geschlossen.

1 Antwort

Participating Frequently
November 28, 2012

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

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