I am having a problem with inserting a new item at the end of my MySQL table. When I insert the new item it appears after the last created item, but I want it to be entered at the bottom of the table. Suppose that I have a table id = int,Primary Key and album=string and the table is:
- Wrath
- Crack The Skye
- Enter Shikari
What would the MySQL query be if PHP variable $album=myAlbum was to be inserted next, at the end of the table, and with the appropriate id?
You have to understand what a database is.
There is no “end” in the database. The rows take order only at the SELECT time.
So, you have to add an
ORDER BYclause to yourSELECTquery to make rows in the desired order.You may add another field to order your table by or use an existing one.