<?php
$userId = isset($_GET['id']) && is_numeric($_GET['id'])?trim($_GET['id']):0;

if(isset($_POST['Submit'])) {
	$access_var = isset($_POST['chk_sub'])?implode($_POST['chk_sub'],','):'';
	mysql_query("UPDATE tbl_section SET `access` = '".$access_var."' WHERE id = '$userId' ");
	header('location:index.php?page=view_section');
}

$resAccess1 = mysql_fetch_array(mysql_query("SELECT * FROM tbl_section WHERE id = '$userId'"));
$accessArray1 = explode(',',$resAccess1['access']);
?>