Code: Select all
<?php if((($row_rsDisplay['wedding']) != '00-00') || (!empty($row_rsDisplay['wedding'])))
{ echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];}?>Moderator: General Moderators
Code: Select all
<?php if((($row_rsDisplay['wedding']) != '00-00') || (!empty($row_rsDisplay['wedding'])))
{ echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];}?>Code: Select all
<?php
if
{
(($row_rsDisplay['wedding']) != '00-00') || (!empty($row_rsDisplay['wedding']))
}
else
{
echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];
}?>Code: Select all
// Only output Aniversary if wedding is not empty and not equal to 00-00
if (($row_rsDisplay['wedding']) != '00-00') && (!empty($row_rsDisplay['wedding'])) {
echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];
}sorry, microthick is right, however i dont understand the format in the code that was provided firstmicrothick wrote:Isn't an && warranted in this situation and not || ?
Code: Select all
// Only output Aniversary if wedding is not empty and not equal to 00-00 if (($row_rsDisplay['wedding']) != '00-00') && (!empty($row_rsDisplay['wedding'])) { echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding']; }
Code: Select all
<?php if(($row_rsDisplay['wedding']) == '00-00')
{}
elseif(empty($row_rsDisplay['wedding']))
{}
else
{
echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];
}
?>Code: Select all
if($row_rsDisplay['wedding'] == '00-00') $row_rsDisplay['wedding'] = '';
if(!empty($row_rsDisplay['wedding'])){
echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding'];
}there most definitely is.theoph wrote:Got it to work using the following script, but there must be a better way to write it though.-DAVECode: Select all
<?php if(($row_rsDisplay['wedding']) == '00-00') {} elseif(empty($row_rsDisplay['wedding'])) {} else { echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding']; } ?>
Code: Select all
<?php
// Only output Aniversary if wedding is not empty and not equal to 00-00
if (($row_rsDisplay['wedding']) != '00-00') # test that it's not equal to '00-00'
&& # and set another conditionthat MUST be met
(!empty($row_rsDisplay['wedding'])) { # make that not being empty
echo '<span class="underline">Anniversary:</span> ' . $row_rsDisplay['wedding']; # do what needs to be done then
}
?>