If you want the max if HUF, KM, EURO, KUNA you should do
$sqlquery = "SELECT MAX(HUF) as HUF,MAX(KM) as KM, MAX(EURO) as EURO,
MAX(KUNA) as KUNA from $table limit 1";

"Ron Allen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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");
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to