iceblox Posted July 20, 2007 Share Posted July 20, 2007 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? Quote Link to comment Share on other sites More sharing options...
phat_hip_prog Posted July 20, 2007 Share Posted July 20, 2007 Maybe your number is set as a float, you could try 'gettype()' to see if it's an integer? Quote Link to comment Share on other sites More sharing options...
lewis987 Posted July 20, 2007 Share Posted July 20, 2007 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 Quote Link to comment Share on other sites More sharing options...
iceblox Posted July 20, 2007 Author Share Posted July 20, 2007 Thanks Lewis, I think i completed things with all the if statements lol i changed what you said and removed some unused ifs and sorted it. So thanks for your help again Lewis! Phil Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.