priya171 Posted April 30, 2013 Share Posted April 30, 2013 i have table call test id name dob mobile 1 xyz 1989-01-11 9878785687 2 pqr 2012-01-11 9977889988 3 abc 2010-09-19 7766554433 id is auto increment. now i have to add a record between 1 and 2 like udp 1977-09-08 9898009800 So my data table should be like this: id name dob mobile 1 xyz 1989-01-11 9878785687 2 udp 1977-09-08 9898009800 3 pqr 2012-01-11 9977889988 4 abc 2010-09-19 7766554433 Help me.... Quote Link to comment https://forums.phpfreaks.com/topic/277441-insert-record-into-mysql-table-having-id-auto-increment-between-two-existing-row/ Share on other sites More sharing options...
Barand Posted April 30, 2013 Share Posted April 30, 2013 ID values are unique identifiers given to records on insert and, once allocated, should never change. Your application should work exactly the same if MySql allocated ids randomly instead of sequentially (easier and quicker). If they were allocated randomly, where would you put your new record? What is there about that record that makes it imperative that it go between 1 and 2? Quote Link to comment https://forums.phpfreaks.com/topic/277441-insert-record-into-mysql-table-having-id-auto-increment-between-two-existing-row/#findComment-1427321 Share on other sites More sharing options...
fenway Posted May 5, 2013 Share Posted May 5, 2013 Auto-increments means "I don't care about the value you choose". Quote Link to comment https://forums.phpfreaks.com/topic/277441-insert-record-into-mysql-table-having-id-auto-increment-between-two-existing-row/#findComment-1428424 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.