MAX for a column

From: Date: Tue, 16 Apr 2002 13:14:02 +0000
Subject: MAX for a column
Groups: php.db 
Request: Send a blank email to php-db+get-18543@lists.php.net to get a copy of this message
I am trying to determine how to use the MAX() function I was thinking about this $sqlquery = "SELECT MAX(HUF,KM,EURO,KUNA) from $table limit 1"; any suggestions here is the code: mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database"); @mysql_select_db("$DBName") or die("Unable to select database $DBName"); $sqlquery = "SELECT * FROM $table"; $result = mysql_query($sqlquery); $number = mysql_numrows($result); $i = 0; if ($number < 1) { } else { while ($number > $i) { $EURO = mysql_result($result,$i,"EURO"); $EURORECON = mysql_result($result,$i,"EURORECON"); $KM = mysql_result($result,$i,"KM"); $KMRECON = mysql_result($result,$i,"KMRECON"); $HUF = mysql_result($result,$i,"HUF"); $KUNA = mysql_result($result,$i,"KUNA");

« previous php.db (#18543) next »