Ok I am working something that I have seen others do and that is to echo out a form table and what I am
trying to do is to get the data that is not assigned to a user and allow the admin to assign it to the user. I cannot get it to clear the table when it is assigned and run the query to only display the un-assigned ones. I may be wrong in doing this but I was trying to do something different. Any one have any suggestions.
do
{
echo '<option value="',$row_rsinspector['contact_id'],'">',$row_rsinspector['Inspector'],'</option>';
$id_inspector =$row_rsinspector['contact_id'];
}while ($row_rsinspector = mysql_fetch_assoc($rsinspector));
$rows = mysql_num_rows($rsinspector);
if($rows > 0)
{
mysql_data_seek($rsinspector, 0);
$row_rsinspector = mysql_fetch_assoc($rsinspector);
}
echo '</select></td>';
echo '<td width="%"><input type="submit" value="Submit"/></td>';}
echo '</form></td></tr>';
echo '</table>';
?>
The update database is done using the following:
if(isset($_POST['id_inspection'], $_POST['inspector']))
{
$idinspection = $_POST['id_inspection'];
$id_inspector = $_POST['inspector'];
mysql_query("UPDATE inspection SET idemployee ='$id_inspector',last_modified = now(), assigned ='0'
WHERE idinspection ='$idinspection';");
}