<?php
session_start();
include 'dbc.php';


$userid=$_SESSION["userid"];
$class_name=$_POST["class_name"];
$class_name1=$_POST["class_name1"];
$code=$_POST["code"];
$sql = "select * from admission where class_name='$class_name' and user_id='$userid'";
$admission=mysql_query($sql) or die("Error : " . mysql_error());
    
while($ppp=mysql_fetch_array($admission))
{
  
	$sql2="update admission set class_name='$class_name1' where class_name='$class_name' and user_id='$userid';";
	mysql_query($sql2) or die("Error : " . mysql_error());
	

	 }
	echo "Class Promotion Sucessfully";
?>
<a href="class_promotion.php">Back</a>