abyssal Posted April 6, 2012 Share Posted April 6, 2012 Hi, I have a table with a column that has auto increment. I deleted the table's content but when I add new data it starts from 23. How can I reset it back to 0 ? Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/ Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 try TRUNCATE (tablename) Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/#findComment-1334919 Share on other sites More sharing options...
abyssal Posted April 6, 2012 Author Share Posted April 6, 2012 Thanks man ! Really appreciate. Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/#findComment-1334922 Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 no worries Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/#findComment-1334923 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 Be sure you don't want any data in the specified table as TRUNCATE will remove all the data... It's not a simple function to reset the auto-increment value to 0. Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/#findComment-1334994 Share on other sites More sharing options...
abyssal Posted April 6, 2012 Author Share Posted April 6, 2012 Be sure you don't want any data in the specified table as TRUNCATE will remove all the data... It's not a simple function to reset the auto-increment value to 0. Yep, I'm building a php/sql app and my table was only for testing, so no important data lost . Thanks ! Link to comment https://forums.phpfreaks.com/topic/260449-how-to-reset-auto-increment-to-0/#findComment-1335090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.