Sorry, should have sent the whole code, but it seems so long. The part I sent is #2.
Not sure what you mean by use php tgs, thought I had used them everywhere?
Here are $queries 1 & 2. $1 is chosen, prints name, is used in $2 (still on same page refreshed tho, but could be a new one). Name #2 is chosen from the options list selected in WHERE clause, and is printed. This means that name #1 disappears. Ideally it would be saved outside the function (am I saying this right?) so I could echo both choices together somewhere on the form (either they both stay in the window when selected, or they both get printed somewhere).
This is for convenience for the end user, so he can remember which plant name he is working on. I don't think it will affect the correct function of the finished form, which will add a (long & complicated) post to the main database table.
I will not try to digest your suggestion until I know whether we were talking about the same thing.. but thanks and I will use it after (I hope) clarification.
<?php //and all the connection stuff etc. and $var declarations (shall I send the whole page??)
$query1 = mysql_query("SELECT GenusID, GenusName FROM GENUS AS G ORDER BY GenusName ");
$query2 = mysql_query("SELECT S.GenusID, SpeciesName, S.SpeciesID FROM GENUS AS G, SPECIES AS S WHERE S.GenusID=G.GenusID AND S.GenusID=". $var ." ORDER BY SpeciesName");
?>
<FORM method="GET" action= "soerentest_static.php">
<select name="genusname">
<option selected value="">Vælg Genus</option>";
<?php
WHILE($row = mysql_fetch_array($query1))
{
echo '<option value="'.$row["GenusID"].'">'.$row["GenusName"].'</option>';
}
?>
</select>
<input type= submit name="genusform" value="Vælg">
</form>
<?php
echo $genussql;
?>
<FORM method="GET" action= "soerentest_static.php">
<select name="artsname">
<option selected value="">Vælg Art</option>";
<?php
WHILE($row = mysql_fetch_array($query2))
{
echo '<option value="'.$row["SpeciesID"].'">'.$row["SpeciesName"].'</option>';
}
?>
</select>
<input type= submit name="artsform" value="Vælg">
</form>
<?php
echo $artssql;
?>