Thanks Chris and Robert! With both of your code suggestions and ideas, I resolved it. It took me a bit longer than it should have as I wasn't familiar with array_diff() and it isn't in the version of manual on this site but is on www.php.net.
This script will list all used and unused priorities, even if they are not in sequential order; ie 1, 3, 5, 8, 10 are used and 2, 4, 6, 7, 9 are not. The snippet that used the list() function wouldn't work right when the numbers weren't in sequence.
Here is the code I used to get the basics and, now that it works, I will add the rest for the various city information:
<?php
require("./include/sql-header.inc");
$all_priorities = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
$query = "SELECT id, priority FROM expedite ORDER BY priority";
$result = mysql_query($query);
echo "<table border=1 cellpadding=5><tr>\n
<td>These Priorities have already been used: ";
if ($row = mysql_fetch_array($result)) {
do {
$used_priorities[$row["id"]] = $row["priority"];
printf("<a href=\"./review.php?id=%s\">%s</a> \n", $row[id],$row[priority]);
$records[$row["priority"]] = $row["id"];
} while ($row = mysql_fetch_array($result));
}
echo "</td><td> These are available for use: ";
$unused_priorities = array_diff($all_priorities, $used_priorities);
for ($x=0;$x<11;$x++) {
if ( $unused_priorities[$x] ) {
echo " $unused_priorities[$x] ";
}
}
echo "</td></tr></table>";
?>
Thanks again!
--->Rob