<?php

include 'connect.php';

$sno=0;
$sel=mysqli_query($conn,"select * from sales_order group by orderno order by orderno asc");
while($sel1=mysqli_fetch_assoc($sel))
{

$sno=$sno+1;

$ups=mysqli_query($conn,"update sales_order set ordno='$sno' where orderno='$sel1[orderno]'");

}

?>