<?php
function tbl_tool_id($tbl,$st=1) {
  global $db,$ar;
  $sql4 = "select id from `".$tbl."` where id>$st order by id";
  $res4 = mysqli_query($db, $sql4);
  $a=$st;
  while($r4 = mysqli_fetch_assoc($res4)) {
    $udt=array(
      'id2'=>$a,
    );
    Update($db,$tbl,$udt,"id=".$r4['id'],1);
    $a++;
  }
  $sql3="UPDATE `".$tbl."` set id=id2 where id>=".$st;
  $res3=mysqli_query($db,$sql3);
  $sql5="ALTER TABLE `".$tbl."` AUTO_INCREMENT=".$a+1;
  $res5=mysqli_query($db,$sql5);
  echo $sql5."<br>";
}
?>
/home/u1731472/public_html/
sub/cpapp_ekbis/app.function.php