在提交时更新数据库字段

when the admin ticks a row or more in the table and clicks on the approve button, that row data (request_id is the primary key) should be updated in the database field is_approved and should change 'pending' to 'approved' The is_approved field has two enum: pending and approved. How can i do this?

<form action = "admin.php" method = "post"> 
<input type="button" name="accept" value="accept" />
<input type="hidden" name="submitted" value="TRUE" />    
</form>

PHP code:

if(!empty($_POST['accept'])) {
    $request_id = $_POST['request_id'];

    foreach($request_id as $is_approved) {
     $query = mysql_query("UPDATE request SET is_approved = 'approved' where is_approved =$request_id");
    }
}

Change your form as:

<form action = "admin.php" method = "post"> 
<input type="button" name="accept" value="accept" />
<input type="text" name="request_id[]" value=1/>
<input type="text" name="request_id[]" value=2/>
<input type="hidden" name="submitted" value="TRUE" />    
</form>

The value should be your actual request_id