<?php

	include"../../connect/db.php"; 

	if( isset($_POST['user']) ){

		$user = $_POST['user'];
		$level = $_POST['level'];
		$code = $_POST['code'];

		$sql = mysqli_query($con,"UPDATE code SET $level = '$code' WHERE user = '$user' ");

		if( $sql ){
		
			if( $sql ){
				echo "success";
			}
			else{
				echo "error";
			}
		}
		else{
			echo "error";
		}
	}
	else{
		echo "error";
	}
	
?>	