<?php
include 'dbc.php';





$size = count($_POST['fam_no']);

$i = 0;
while ($i < $size) {
	$fam_no= $_POST['fam_no'][$i];
	$std_name= $_POST['std_name'][$i];
	
	$id = $_POST['id'][$i];
	$sql2 = "SELECT * FROM familyno where fam_no = '$fam_no' and  user_id='$userid'";
$result2=$conn->query($sql2);
$row2 = $result2->fetch_assoc();
$all_name=$row2['std_name'] ;
$updat_name=$all_name . ":" . $std_name;
 	
	$sql1 = "UPDATE admission SET barcode='$fam_no' WHERE id='$id'";
$conn->query($sql1);
$sql3 = "UPDATE familyno SET std_name='$updat_name' WHERE fam_no='$fam_no'";
$conn->query($sql3);
	
	++$i;

// do the update and print out some info just to provide some visual feedback



} 
echo "Record Update";
?>
<a href="Eisting_Family_Alocate.php"> Back </a>