max()的参数计数错误

I'm trying to show the max value of column teams from mysql. Above the while loop I've selected teams from my mysql table and then as you can see in my code below I have included max($teams) - but it is returning an error? Where am I going wrong.

while ($rows = mysql_fetch_assoc($result)) { 

$teams = $rows['teams'];


if($teams > "1") {

echo '<div class="bestbettor">'.'<span class="redtext">'."Bettor: ".'</span>'. $rows['username'].'</div>'; 
echo '<div class="bestbettor">'.'<span class="redtext">'."   Bet: ".'</span>'.max($teams). " team accumulator".'</span>'.'</div>'; 
}

}

you must pass an array to max().

$teams = $rows['teams']; // saves as string.

if your teams were delimited by a comma then you could do something like:

$teams = explode(",",$rows['teams']); // saves as array

then you could do max()

If one parameter is given to max() it has to be an array of values of which max() will return the highest value in that array. It seems like you've just given it a single string.