I am trying to get the maximum value in field "id".
What is really happening is that "$id" is actually taking the lowest value of the "$rowid" array.
How do I get the highest value in "$rowid"?
P.S. You can not take the "max" of a null array.PHP Code:$sql = "SELECT `id` FROM `table1`";
$result = mysql_query($sql, $conn);
$rowid = mysql_fetch_array($result, MYSQL_ASSOC);
if ($rowid != "") {
$id = max($rowid);
}



Reply With Quote





Bookmarks