<?php
include("./fnc.php");

$q=mysql_query("select carnet from alumnos where carnet > 20080000");
while($i=mysql_fetch_array($q)){
  $npass=base64_encode(substr($i[carnet],-4));
  $sql="update alumnos set clave = '$npass', clave_web='$npass' where carnet = '{$i[carnet]}'";
  $r=mysql_query($sql) or die(mysql_error());
  echo "$sql;<br>";
}
?>
