I have a MySQL table for the comments on my site, and an admin feature for me to delete them. Posting replies and deleting works fine, but whenever someone posts after I deleted something the post is put in the gap. Like this:
Before deleting:
1. hi
2. hello
3. how are you
4. [spam]
5. how rude
After deleting:
1. hi
2. hello
3. how are you
5. how rude
Next post
1. hi
2. hello
3. how are you
6. what was rude?
5. how rude
How can I make sure that an entry is inserted at the end of the MySQL table, not filling any gaps?
Do you have the ID set as the Primary Key? If so, it should sort all the entries by that key.
I do, but it still does what I described.
Post the code you are using to SELECT your rows.
You should order by date or ID.
Nevermind, I fixed it. Thanks for all your help though
Unless you include an ORDER BY clause in your query, you can't rely on the results to be in any particular order.
Sorry, you need to Log In to post a reply to this thread.