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");
}
}