chrisjchrisj — 2012-12-07T19:17:37-05:00 — #1
How do I delete all the entries in a phpmyadmin table without deleting each one manually?
Is there a way to delete a large amount of entries (but not all) from a phpmyadmin table without doing it manually?
spacephoenix — 2012-12-08T02:19:07-05:00 — #2
To delete all entries in a table you can use the "Empty" button. To delete certain records only use a DELETE query, build the DELETE query as a SELECT query first to make sure that you'll only be deleting what you expect to be deleted. Once you've triple checked and check again that only what you expected to be deleted has been selected, convert the SELECT query to a DELETE query
r937 — 2012-12-08T04:27:51-05:00 — #3
use this, it's easier --
TRUNCATE TABLE mytable
chrisjchrisj — 2012-12-08T10:43:28-05:00 — #4
Thanks for your replies.
Truncate table my table is used for which scenario?
There's a table where I just want to keep the admin entry and remove all the rest. Is there any easy way to do that?
r937 — 2012-12-08T12:26:06-05:00 — #5
the scenario you described in your original post -- "delete all the entries in a phpmyadmin table without deleting each one manually"
use DELETE with a WHERE clause
ramasaig — 2012-12-08T13:25:03-05:00 — #6
Nobody seems to have mentioned that in a phpMyAdmin table, if you go to 'Browse' and scroll to the bottom you can click 'Check All' to select all the records, and then click 'Delete' (also at the bottom). If you want to keep some individual records, uncheck them (on the left of each record) before deleting.
And make a copy of the table first, just in case.
guelphdad — 2012-12-13T11:44:28-05:00 — #7
and of course the important thing... There is no such thing as a phpmyadmin table. The table exists in the database, of which phpmyadmin is ONE of numerous tools to interface with the databases.