php - Reorder the sequence of records in mysql -
how rearrange multiple records after deleting multiple records.my code deletes 1 record , rearrange records when delete multiple records,it cant reshuffle.
this codes works great when delete 1 record not work multiple records,
$sql="delete $user id='$id'"; $result=mysql_query($sql,$connection) or die(mysql_error()); $reorder = "update $user set id=id-1 id > $id"; $catch = mysql_query($reorder,$connection);
you may need query for rows require reorder, re-order them calling update statement 1 @ time, careful set id='xx-1' id='xx'
Comments
Post a Comment