Thanks.
My first attempt:
In the following test example that I've been working with, I'm trying to calculate the maximum value of a numeric INT field called count in a table called Britishism:
Code: Select all
$sql="SELECT MAX(count) as $maxcount FROM Britishism";
$result2 = mysql_query($sql);
echo "Highest count is ".$result2;while ($row = mysql_fetch_assoc($result)) {
}
My second attempt:
I also tried something like the following, without using MAX directly in a SELECT statement, but instead, calling the function during the execution of a WHILE statement, as in:
Code: Select all
while ($row = mysql_fetch_assoc($result)) {
$maxcount = MAX($row['count']);
echo "Highest value in count field is ".$maxcount;...but that didn't work either.