...

View Full Version : less than, more than tags.



SMGames
08-05-2007, 02:39 AM
Hi, i have this:



elseif($row['id'] < 200){

echo
'<td><img src=image title="some title"></td>';

}

And it works fine however i also have this:


elseif($row['points'] > 1600){

echo
'<td><img src="image" title="some title"></td>';

}

The problem is, is that on the > tag it only shows 1 image no matter how high the points, the highter the points you have you will have a different image, but it only shows the same 1 all the time.


PLEASE NOT THE ELSEIF IS MENT TO BE THERE, OTHER IF'S ARE BEFORE THEM!

whizard
08-05-2007, 02:46 AM
is the variable an integer or a string?

HTH
Dan

CFMaBiSmAd
08-05-2007, 03:41 AM
The posted code is not nearly enough for anyone to help you with why you are getting the same image.

If you have a series of conditional statements that are supposed to output a different image depending on how large a value is, the only way for anyone to see what the problem might be with the logic or the data, is if you post all the relevant actual code. For all we know, the actual conditional logic is correct, but you are getting the same image because you are using the same image url in all the logic...

rafiki
08-05-2007, 10:50 AM
use

($points >1600 && $points < 2000) {
echo 'between 1600 and 2000';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum