robert_gsfame Posted May 25, 2010 Share Posted May 25, 2010 I use truncate in emptying my table...n i found that ID which is an autoincrement start again from 1..I just want to ask whether it is possible to empty the table but when i INSERT some records, ID continue from what i had before..so if i truncate the table which has 1000 records (ID from 1 - 1000), i will have ID no 1001 when inserting new record Thx Quote Link to comment https://forums.phpfreaks.com/topic/202841-truncate-simple-question/ Share on other sites More sharing options...
premiso Posted May 25, 2010 Share Posted May 25, 2010 Yea, use the delete statement: DELETE FROM table_name WHERE 1=1 Should erase all data, but allow the autoincrementing id to persist. Quote Link to comment https://forums.phpfreaks.com/topic/202841-truncate-simple-question/#findComment-1063122 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.