Jump to content

[SOLVED] Find Highest Value


MoFish

Recommended Posts

Hello.

 

Im trying to find the highest value of a value in my database called LeagueWoodenSpoon.

 

On the highest value, i want to set $image="spoon.gif"

 

i tryed the following code, but it adds a spoon.gif to everything over 0 and not only the highest value

 

can anyone point me in the right direction?

 

the following code is inwith a loop which goes through every value in my database.

 

$SpoonFlag = 0;

if($row_SelectAllLeague['LeagueWoodenSpoon'] > $SpoonFlag){
  $SpoonFlag = $row_SelectAllLeague['LeagueWoodenSpoon'];
  $image='spoon.gif';
}

Link to comment
https://forums.phpfreaks.com/topic/50129-solved-find-highest-value/
Share on other sites

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.