sorry if i was not clear enough, ill try to explain exactly what i need to do. <? $n1 = 0; include('dbconn.php'); $sql = "select * from formfields WHERE category='$category' order by formfield"; $result = @mysql_query($sql, $dbh); while ($Array = @mysql_fetch_array($result)){ $formfield = $Array['formfield']; $n1 = ($n1 + 1); echo "<tr><td>$formfield: <br><select name=\"title$n1\">"; $sql2 = "select * from formoptions WHERE formfield='$formfield' order by formoption"; $result2 = @mysql_query($sql2, $dbh); while ($Array = @mysql_fetch_array($result2)){ $formoption = $Array['formoption']; echo "<option name=\"$formoption\">$formoption</option>"; } echo "</select></br>"; } ?> which creates a bunch of forms that looks like ExampleForm1: <select name="info1"> bunch of options </select> ExampleForm2: <select name="info2"> bunch of options </select> ExampleForm3: <select name="info3"> bunch of options </select> etc... the variable $formfield is the name of the form. in this case ExampleForm1, ExampleForm2, etc after the user has filled in the forms i want to input both the name of the form and the user input into a database. so for each form made i would do something similiar to <? $info = $_POST['info1']; $formfield = ??????; $sql3 = "insert into forms (title, info) values ('$formfield', 'info')"; ?> I hope this makes it clearer :)