php组合框和按钮应该隐藏一旦更新到mysql数据库并显示成功消息而不是组合框和按钮位置。

here i updated one field value through user input form (combo box type). update process is working perfectly. but, after data stored in db it should show the value what i'm selected in combo box and then that combox box & update button must hide once updated and it should show message "updated successfully" instead of combo box & button. NOT USING JAVASCRIPT ALERT METHOD. THIS IS NOT A ALERT MESSAGE. once updated data in db that combo box should hide and then success message should show in that particular .

this is my main page coding :

while($a_row = mysql_fetch_array($sql))
    { 
            echo "\t<td>" . $a_row['guestname'] . "</td>";
            echo "\t<td>" . $a_row['agentname'] . "</td>
";
        echo "\t<td><form action=statusdb.php method=post>
        <select name=update><option value=empty></option><option value=Confirm>Confirm</option><option value=Processing>Processing</option><option value=Pending>Pending</option><option value=Cancelled>Cancelled</option></select>
        <input name=id type=hidden value='".$a_row['slno']."';>
        <input type=submit value=Update>
       </form>
        </td>
";
        echo "</tr>
";
    }

this is my statusdb coding :

if (isset($_POST['id']))
{ 
$id = mysql_real_escape_string($_POST['id']);
$update= mysql_real_escape_string($_POST['update']);
$sql = mysql_query("UPDATE guest_details SET status = '$update' WHERE slno = '$id'");
if(!$sql)
{
    die("Error" .mysql_error());
}
else
{
    echo "<html><body onload=\"alert('Status Updated Successfully');\"></body></html>";
}
}

I'm thinking this would work.

Try adding the following after the line echoing the agentname:

if ( $a_row['status'] != 'empty' ) {
    echo "\t<td>" . $a_row[$status] . "</td>
";
} else {
    // here's where you'd put the next 6 lines
}

PS: I don't see an opening <tr> tag.