HTML/Javascript

SES by business degree online promotion team.

Philippine Airlines International Flight schedules

Philippine Airlines International Flight schedules
Philippine Airlines International Flight schedules

Search This Blog

Wednesday, October 6, 2010

SQL display the highest number Function using MAX() Function

The purpose of this is to display highest number value from specific field of a table's Msql Database.

code to paste:

//protected area orig3 file
$query = "SELECT MAX(ttravelid) FROM travelid";
$resultx = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($resultx))
{
//echo "The most highest reservation id is ".$row['MAX(reservationid)'];
$ttravelid1 = $row['MAX(ttravelid)'];
//or your can display this side echo $ttraveliddd;
}

echo "the highest number is:<br>";
echo $ttravelid1;

No comments:

Post a Comment