My php application i want to display a icon when it exeed some value. Eg: I have rainfall values in my database and if some value exeed the given higher limit the icon sholud display on my web page. How can i do that?
Display icon if database value exeed some limit
Collapse
X
-
Originally posted by markusn00b[php]
if($_waterfall_ measurement > 200)
{
echo "<img src='exceeded.j pg' />";
}
else
{
echo "<img src='green.jpg' />";
}
[/php]
Just use an if statement :)
If the measurement is greater than 'whatever', show relevant image.
Regards
This is what i have done. I want to get the value which exceed threshold value. how can i do that?[PHP]$qq = mysql_query("SE LECT Rainfall_ID,Sta tion_ID,Rainfal l FROM rainfall ORDER BY Rainfall_ID");
while($row = mysql_fetch_arr ay($qq)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
echo "$Station_ID".' ,'."$Rainfall" ;
}
$qq = mysql_query("SE LECT Station_ID,Thre shold_Val FROM station ORDER BY Station_ID");
while($row = mysql_fetch_arr ay($qq)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
echo "$Station_ID".' ,'."$Threshold_ Val";
}[/PHP]Comment
Comment