View file panel/index_page/function.php

File size: 317B
<?php

//пересчет позиций ссылок
function reposition($page){
 $q=mysql_query("SELECT `id` FROM `link` WHERE `page`='$page' ORDER BY `position` ASC;");
$i=0;
while($data=mysql_fetch_array($q)){
  $i++;
  mysql_query("UPDATE `link` SET `position`='$i' WHERE `id`='$data[id]';");
}
}

?>