jd2007 Posted July 21, 2007 Share Posted July 21, 2007 sometimes in a mysql table after changing and adding few stuff in it using php, the id column doesn't display numbers in proper sequence for example 1,3,2,4,5,7,6....how to prevent this from happening ? Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 21, 2007 Share Posted July 21, 2007 Don't use the (presumably) auto-incremented id field to display. Use a counter in your display loop if you really want to show a 'number' for each row. ctr = 0; while ... { $ctr++; echo "Rank: ". $ctr. " Bob ... " ... etc Quote Link to comment Share on other sites More sharing options...
jd2007 Posted July 21, 2007 Author Share Posted July 21, 2007 the numbers i mentioned are not displayed on the browser. its the id usually used on a mysql table. Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 21, 2007 Share Posted July 21, 2007 the id column doesn't display numbers in proper sequence the numbers i mentioned are not displayed on the browser. its the id usually used on a mysql table. Then we need a far clearer explanation of your problem. 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.