<?php

include 'connect.php';

$sno=0;
$sel=mysql_query("select * from sales_order group by orderno order by orderno asc");
while($sel1=mysql_fetch_array($sel))
{

$sno=$sno+1;

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

}

?>