<?php
require_once '../../library/config.php';
require_once '../library/functions.php';
require_once '../library/logged.php';
require_once '../../library/validation.php';

if (isset($_POST['id'])){
	$id = isNumber(trim($_POST['id']));
	$id_name = txt_only($_POST['id_name']);
	$field = txt_only($_POST['update_field']);
	$show = isNumber(trim($_POST['show']));
	$table_name = txt_only($_POST['table']);
	
	mysql_query("UPDATE `".$table_name."` SET `$field` = '$show' WHERE `$id_name` = '$id'", $connePaper);
	mysql_close($connePaper);
}
?>