开发者

mysql , after a deletion, last inserted row sits just in the place of the deleted one

I am not going to paste the code here and hope the statement of the prob is enough to pose the question .

i inserted 3 rows in a mysql table, deleted the 2nd one and then inserted the 4th one and all these things i did by writing code in php. but the 4th one sits in the place of the deleted one. That is I wanted the order of the ids(primary key) to be 1,3,4. but now it be开发者_JAVA百科comes 1,4,3.

Thanks in advance for any solution.

Istiaque Ahmed Bangladesh


if you dont specify the sort order in your query then the db can return the rows in any order, so specify the sort order and all will be well


Change the table storage engine to InnoDB.

MyISAM and InnoDB

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜