$page .= "<select name=\\"year\\">\
<option selected value=\\"".$year."\\">".$year."</option>\
";
$query = "SELECT DISTINCT " .
"year " .
"FROM {{table}} " .
"ORDER BY year ASC";
$result = doquery($query, "teams");
while ($row = mysql_fetch_array($result)) { $page .= "<option value=\\"".$row['year']."\\">".$row['year']."</option>\
"; }
$page .= <<<END
</select>
</td>
<td>State:
END;
$page .= "<select name=\\"state\\">\
<option selected value=\\"".$state."\\">".$state."</option>\
";
$query = "SELECT DISTINCT " .
"state " .
"FROM {{table}} " .
"ORDER BY state ASC";
$result = doquery($query, "teams");
while ($row = mysql_fetch_array($result)) { $page .= "<option value=\\"".$row['state']."\\">".$row['state']."</option>\
"; }
Should there be two queries like so in this? Could it just be made like:
$query = "SELECT DISTINCT " .
"year, state " .
"FROM {{table}} " .
"ORDER BY year, state ASC";
If so, how would you reset $result to use it twice?