<?php
	require "../commonincludefiles.php";
	$sql = "select college_id,student_id,branch_id,semester_id from cms_studentmaster";
	$res = dbQuery($sql);
	echo dbRows($res);
	$i = 1;
	while($rec = dbArray($res))
	{
		$insert = "insert into cms_studentdetail(college_id,student_id,cur_branchid,cur_semesterid,current_active,year_id)
					values(".$rec['college_id'].",".$rec['student_id'].",".$rec['branch_id'].",".$rec['semester_id'].",1,1)";
		dbQuery($insert);
	}
?>