<?php

	/*echo md5('');*/

	include_once 'includes/functions.php';

	$st = 0;
	//Test case for  migrating from SED-CRS (228) to CRS-SED (1)
	$r = mysql_query("SELECT * FROM `applicants_nce` WHERE programme_applied_for = 228");//228 to be changed
	if(mysql_num_rows($r) > 0 )
	{
		while($row = mysql_fetch_array($r, MYSQL_ASSOC))
		{
			//get matric
			$stud_id = $row['id'];
			$pt = 1;


			//change this variables value 
			$sch = 3;
			$dept = 14;
			$prog = 121;


			//change as required
			$r2 =mysql_query("UPDATE `applicants_nce` SET  `school_id` = '$sch', `school_applied_for` = '$sch', `department_id` = '$dept',  `department_applied_for` = '$dept',`programme_id` = '$prog', `programme_applied_for` = '$prog' 
				WHERE `programme_applied_for` = 228 AND id = '$stud_id'");//change 228
			
			if ($r2) {
				$st++;
			}
			
		}
	}else{
		echo 'No Records<br>';
	}
	

	



	echo 'Total Success= '.$st;

?>