I am trying to get the Id # from a mysql database and have it be the value in a pull-down. My code is delivering the value....but it loops the form. I want the values in one pull down ...but it is delivering different values in multiple forms.
Where have I made my mistake?
<?
$username="xxx";
$password="xxx";
$database="xxx";
mysql_pconnect('xxx',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
// Below will display listings for specific ID///
$query="SELECT * FROM residential WHERE lister_office_name='name';
$result=mysql_query($query) or die (mysql_error());
$num=mysql_numrows($result);
?>
<?
while ($row = mysql_fetch_array($result)) // this will grab the results from query
{
?>
<form method="POST">
<tr>
<td width="22%">Select MLS to edit</td>
<td width="1%"> </td>
<td width="77%"><select size="1" name="D1">
<option value="<? echo $row[Id]; ?>"><? echo $row[Id];?></option>
</select></td>
</tr>
<tr>
<td width="22%">Is this a featured listing?</td>
<td width="1%"> </td>
<td width="77%">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><input type="radio" value="V3" checked name="R1">Yes</td>
<td width="50%"><input type="radio" name="R1" value="V4">no</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="22%"> </td>
<td width="1%"> </td>
<td width="77%"> </td>
</tr>
<tr>
<td width="22%">Agents Comments:</td>
<td width="1%"> </td>
<td width="77%"><textarea rows="5" name="S1" cols="39"></textarea></td>
</tr>
<tr>
<td width="22%"> </td>
<td width="1%"> </td>
<td width="77%"> </td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>
<?
}
?>