Bickey Posted February 1, 2011 Share Posted February 1, 2011 What is the syntaxt which is used to delete all records from a database? Thanks. Bickey. Link to comment https://forums.phpfreaks.com/topic/226381-delete-all/ Share on other sites More sharing options...
mikosiko Posted February 1, 2011 Share Posted February 1, 2011 not clear if you want to: - delete all the records from one table or - delete the database completely with all that it contains I hope you understand the difference between table and database Link to comment https://forums.phpfreaks.com/topic/226381-delete-all/#findComment-1168491 Share on other sites More sharing options...
ttocskcaj Posted February 2, 2011 Share Posted February 2, 2011 If you want to delete every row from a table, but keep the table: DELETE FROM `table_name` If you want to delete the whole table DROP TABLE `table_name` If you want to delete the whole database DROP DATABASE `database_name` It might be best if you use a front end like PHPMyAdmin. Then you can visualize exactly what you're deleting, And BACKUP 1st Good Luck Link to comment https://forums.phpfreaks.com/topic/226381-delete-all/#findComment-1168742 Share on other sites More sharing options...
The Little Guy Posted February 2, 2011 Share Posted February 2, 2011 this will reset everything in your table: TRUNCATE my_table Link to comment https://forums.phpfreaks.com/topic/226381-delete-all/#findComment-1168923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.