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. 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. 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. 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
Archived
This topic is now archived and is closed to further replies.