+
+$sth=$dbh->prepare("SELECT DISTINCT archipelago FROM islands
+ ORDER BY archipelago;");
+$sth->execute();
+my $archlistdata='';
+
+while ($row=$sth->fetchrow_arrayref) {
+ $archlistdata.=
+ sprintf('<option value="%s">%s</option>',
+ map { encode_entities($_) } (@$row, @$row));
+}