Jump to content

[SOLVED] Please help with this if query


iceblox

Recommended Posts

Hi Guys,

 

Im stuck on an if query. Basically if row[7] = 0 dont show anything but if row[5] = 0.00 show XX else show XXX

 

But i seem to be finding that the code is ignoring the first if and skipping to the next row with some results. 

 

 

                if($row[7] == "0") {
                echo'';
                }
                else if($row[5] == "0.00") {
                echo' with <font color="#FF0000">' . $row[7] . ' Months FREE Line Rental</font>';
                }
                else {
                echo'' . $row[7] . ' Months at ' . $row[5] . '';
                }

 

Anyone got any ideas?

Link to comment
https://forums.phpfreaks.com/topic/60984-solved-please-help-with-this-if-query/
Share on other sites

     if($row['7'] == "0") {
               echo'';
               }
               elseif($row['5'] == "0.00") {
               echo ' with <font color="#FF0000">' . $row['7'] . ' Months FREE Line Rental</font>';
               }
               else {
               echo $row['7'] . ' Months at ' . $row['5'];
               }

 

that code will work, u put a space between elseif and you didnt put '' arround the numbers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.