<?php
// Include the database connection file
session_start();
include "menuadmin.php";
include 'config.php';


if (isset($_POST['update'])) 
{
	$kodeuser=$_POST['ikduser'];
    $nama=addslashes($_POST['inama']);
	$kodemapel=addslashes($_POST['ikode']);
	
	
	

		// Update the database table
		$result = mysqli_query($mysqli, "UPDATE `mapel` SET `kode`='$kodemapel',`nama`='$nama' WHERE `Idmapel`='$kodeuser'");
		
		// Display success message
		echo "<p><font color='green'>Data updated successfully!</p>";
		echo "<br> ";
		header("location:mapel.php?ed=1");
		
	}
