Pasa Mike Posted February 18, 2007 Share Posted February 18, 2007 this code is not returning any errors... yet none of the three sections are working properly... They all have the same structure, so whatever is wrong with one is wrong with another.... I am having one additional problem as well... In the price info section, after the year is displayed, a "1" is printed on each line for the 'due1'... 'due2'...etc... <!-- Meet/ Start Time --> <?php if ('time1display' == 0) { echo "Meet Time: "; } else echo "Start Time: "; ?> <span class="Wtext"><?php echo $row_content['time1']; ?> <br /> <!-- End / Return Time --> <?php if ('time2display' == 0) { echo "End Time: "; } else echo "Return Time: "; ?> <?php echo $row_content['time2']; ?></span> </p> <p> <!-- Price information --> <span class="Wtext"> <?php if ('price' == 1) break; elseif ('price' == 2) { echo "Event Cost:"; echo $row_content['due1']; } else { echo "Event Payment Schedule:<br />"; echo "Payment 1: ", $row_content['pay1'], " Due Date: ", print date('M j Y', strtotime($row_content['due1'])), "<br>"; echo "Payment 2: ", $row_content['pay2'], " Due Date: ", print date('M j Y', strtotime($row_content['due2'])), "<br>"; echo "Payment 3: ", $row_content['pay3'], " Due Date: ", print date('M j Y', strtotime($row_content['due3'])), "<br>"; echo "Payment 4: ", $row_content['pay4'], " Due Date: ", print date('M j Y', strtotime($row_content['due4'])), "<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/39002-if-elseif-else/ Share on other sites More sharing options...
JasonLewis Posted February 18, 2007 Share Posted February 18, 2007 you can please wrap your code in the [ code ] [/ code ] tags, take away the spaces, it makes it easier to read. Link to comment https://forums.phpfreaks.com/topic/39002-if-elseif-else/#findComment-187772 Share on other sites More sharing options...
sspoke Posted February 18, 2007 Share Posted February 18, 2007 if ('time2display' == 0) if ('time1display' == 0) will never be 0.. same with if ('price' == 0) elseif ('price' == 2) these will never == what u want them to be maybe you missing a $? Link to comment https://forums.phpfreaks.com/topic/39002-if-elseif-else/#findComment-187813 Share on other sites More sharing options...
Pasa Mike Posted February 19, 2007 Author Share Posted February 19, 2007 Yeah, turns out... I was just way too tired to be coding anything... I was missing my $var. I still can't figure out, why an extra "1" is being printed after the Date or ['due'] fields... Link to comment https://forums.phpfreaks.com/topic/39002-if-elseif-else/#findComment-188442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.