<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];


mysqli_select_db($conn,$zdb);

$getquery = mysqli_query($conn,"select * from member order by brno") or die(mysqli_error($conn));
$ctr = 0;
//browse(mysqli_num_rows($getquery));
while ($fetchquery = mysqli_fetch_array($getquery)) {
    $ctr++;

    $brno = $fetchquery[brno];
    $add1 = $fetchquery[add1];
    $add2 = $fetchquery[add2];
    $add3 = $fetchquery[add3];
    $city = $fetchquery[city];
    $pin = $fetchquery[pin];
    $mobile = $fetchquery[mobile];
    $mobile2 = $fetchquery[mobile2];

        mysqli_query($conn,"UPDATE `member` SET `accode`='$ctr', `grpcode`='010' where `brno` = '$brno' ") or die(mysqli_error($conn));

//    mysqli_query($conn,"UPDATE `member` SET `grpcode`='010', `accode`='$ctr', `add1`='$add1', `add2`='$add2', `add3`='$add3',
//                                      `city`='$city', `pin`='$pin', `mobile`='$mobile', `mobile2`='$mobile2' where `brno` = '$brno' ") or die(mysqli_error($conn));
}
browse("Update Successfully");
?>
