duandi5328 2010-05-24 16:25
浏览 144
已采纳

MySQL插入表的末尾

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:

  1. Wrath
  2. Crack The Skye
  3. 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?

  • 写回答

5条回答 默认 最新

  • drpqxogph15436713 2010-05-24 16:27
    关注

    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 BY clause to your SELECT query to make rows in the desired order.

    You may add another field to order your table by or use an existing one.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?