I am trying to update a table with records that are pulled from the same table so that the user can update them. I am able to pull the information for the user to update but when they submit the changes it only updates the last record. I am very very new at this and would greatly appreciate any help you can give me. The code I have so far is below.
<?php
while($ipget2 = mysql_fetch_object($ipget1)){
?>
<tr>
<td width="25%"><input type="text" name="IP" size="20" Value="<?=$ipget2->IPAddress?>"></td>
<td width="10%"><input type="text" name="Assign" size="20" Value="<?=$ipget2->Assigned?>"></td>
<td width="15%"><input type="text" name="Host" size="20" Value="<?=$ipget2->HostName?>"></td>
<td width="15%"><input type="text" name="DomainName" size="20" Value="<?=$ipget2->Domain?>"></td>
<td width="15%"><input type="text" name="ipid" size="20" Value="<?=$ipget2->IPID?>"></td>
</tr>
<?
if ($submit) {
$insertip = "update ipaddress SET IPAddress=$ipget2->IPAddress, .Assigned=$ipget2->Assigned, HostName=$ipget2->HostName,
Domain=$ipget2->Domain where IPID=$ipget2->IPID";
mysql_db_query("svtvdb", $insertip);
}
}
?>