kyles0623 Posted June 27, 2010 Share Posted June 27, 2010 I am trying to create a simple CMS and when someone deletes an article I want to loop through all of the articles and make it in order. For example, is I have article numbers: 1,2,3,4,5 and I delete 4, then I want to loop through all the articles so it goes and change the article number so it goes 1,2,3,4 and not 1,2,3,5. Help? Quote Link to comment Share on other sites More sharing options...
ldb358 Posted June 28, 2010 Share Posted June 28, 2010 UPDATE users SET id=id-1 WHERE id>$post_id Where $post_id = the id of the post deleted Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 28, 2010 Share Posted June 28, 2010 You already have one thread for this problem, is there some reasons you started a second thread? Quote Link to comment Share on other sites More sharing options...
kyles0623 Posted June 29, 2010 Author Share Posted June 29, 2010 Thankyou so much. That worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.