Bennovations Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

Select MAX Value from MySQL Database using PHP

Views: 363
Votes: 0
Posted: 12 Aug, 2009
by: Patridge B.
Updated: 12 Aug, 2009
by: Patridge B.
$query="SELECT MAX(torder+0) as maxnum FROM triage_order  ;";
$result = mysql_query($query) or die ("couldn't execute query $query ");
$nrows = mysql_num_rows($result);
while($row= mysql_fetch_array($result)) {
       echo "TORDER =" . $row['maxnum'];
       echo "<BR>";
}
Others in this Category
document Assigning a variable to a variable within a loop using PHP
document View Day of the week based on date
document Nested Variable assignments within PHP - Calling a variable with a variable inside a FOR loop
document Multi-dimensional PHP Arrays
document How to Return more than one value from a PHP array
document Function to make all http prefixed URLs in text output hyperlinks
document Populating an array inside of a for loop using PHP
document PHP Function to display the current day and date based on timezone



RSS