OriginalSunny Posted March 12, 2006 Share Posted March 12, 2006 Hi,how do i delete all the data which is stored in my table??thanks. Quote Link to comment https://forums.phpfreaks.com/topic/4778-deleteing-all-data-from-table/ Share on other sites More sharing options...
toplay Posted March 12, 2006 Share Posted March 12, 2006 Use truncate or a delete without specifying a "where" clause. See:[a href=\"http://dev.mysql.com/doc/refman/4.1/en/delete.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/4.1/en/delete.html[/a][a href=\"http://dev.mysql.com/doc/refman/4.1/en/truncate.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/4.1/en/truncate.html[/a]FYI: You could also drop and recreate the table. Quote Link to comment https://forums.phpfreaks.com/topic/4778-deleteing-all-data-from-table/#findComment-16783 Share on other sites More sharing options...
fenway Posted March 12, 2006 Share Posted March 12, 2006 You should be aware the TRUNCATE will reset the auto-increment counters, which DELETE will not. Quote Link to comment https://forums.phpfreaks.com/topic/4778-deleteing-all-data-from-table/#findComment-16811 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.