Dagon, here you go.
mysql_select_db($DB_Local, $Local);
$query_Option = "SELECT `Key`, `Display Order`, Label, Field1 FROM Pages_NavOption WHERE Pages_NavOption.Style='5' ORDER BY `Display Order`";
$Option = mysql_query($query_Option, $Local) or die(mysql_error());
$row_Option = mysql_fetch_assoc($Option);
$totalRows_Option = mysql_num_rows($Option);
Key is the unique key column. Display Order is a unique numeric field that orders the results as determined by myself (1, 2, 3, 4 etc). Label is a text field that will display in the results (Mike, Albert, etc.). There is no GROUP BY because I wanted to return all the rows from this table that meet the WHERE criteria.
Field1 is the field that motivated my question. The values in there are: 4, 5, 6 and they are repeated across rows (there may be more values later). I need to find a way to consistently identify the number of 4, 5, and 6s (and any values added later), and then tell me which row appears last in the results ordered by Display Order.
What I am doing, to the extent it helps, is setting up links in a CSS drop-down menu. For that to work correctly, I need to find a way to set the closing "</ul>" tag when the last '4' '5' or '6' row appears within the order set by Display Order. That tag tells the menu, in effect, when to end submenus.
Nogdog and Johanafm, thanks for your suggestions. I will give them a try right now.