Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-01-16 01:02:48
- theonlydrew
- Member
- Registered: 2006-01-10
- Posts: 21
delete all images and reset image number without doing each one
I have several hundred images and I would like to delete them all, without having to deleting each and every one of them.
Also, once I delete them, how can I reset the image counter of the database back to zero. Because if not, it will just keep counting from the last image like “400.jpg” and start naming my new images from there.
If this is hard to understand let me know.
Drew
Offline
Re: delete all images and reset image number without doing each one
In theory (backup your install before testing anything!) you can do that directly with the appropriate MySQL table.
PhpMyAdmin let you do that. Or it’s a TRUNCATE TABLE txp_image;
statement. You can also reset the id (image counter) with a statement, or PhpMyAdmin.
I did it once, it worked fine for me.
Offline
#3 2006-01-16 04:13:16
- theonlydrew
- Member
- Registered: 2006-01-10
- Posts: 21
Re: delete all images and reset image number without doing each one
Awesome! Thanks a bunch. I learned my way around phpMyAdmin a little bit too. Thats something I’d really like to do, is get down and dirty with some databasing. Oh well. Thanks. It seems to have done the trick, hopefully everything else will function smoothly.
thanks again
Offline
Re: delete all images and reset image number without doing each one
Is there anyone who would be so kind to put up an fairly detailed how-to / step-by-step concerning this small issue. Because I do not know to do with that statement-stuff you’re talking about, sorry.
I would like to reset the image counter. And the article counter as well. I suppose that all phpMyAdmin is structured the same way, or I sure hope so. If it is, I am sure you can help me! Thanks!
Yo!
Offline
#5 2006-02-01 21:18:33
- theonlydrew
- Member
- Registered: 2006-01-10
- Posts: 21
Re: delete all images and reset image number without doing each one
YEah its pretty easy. Just login to your phpMyAdmin, and find the appropriate table down the left hand side (I can’t remember the name of the table right now), and then click the little button beside the name of the table, and once that loads, just hit the big Empty button at the top right of the page. That should bring up a box that says “Are you sure you want to truncate this tablename”, and you say, Holla back tablename.
and then well it takes out all accounts of any info you had in there, like a fresh install. the images are still in your image folder, you just have to re-upload them. Id use this plugin for mass image imports, but beware, its still a little buggy: aba_import_images at this post http://forum.textpattern.com/viewtopic.php?id=11428
I didn’t make a back up before i truncated, you probably should, but dont know how to tell you that. I also only did it for the image counter and not the article counter. I cant currently log in to my mysql server right now because im traveling and i switched my domain to a subdomain, but i will be able to in a few days, after my trip. good luck.
Offline
Re: delete all images and reset image number without doing each one
ah, wish i thought of that instead of doing it the hard way (OR i wish there’s tick boxes for article images instead of the ‘x’ buttons)
Offline
Re: delete all images and reset image number without doing each one
thanks a lot, that worked like a charm! the name of the table was “txp_image”. then i ticked off “id” and then pushed “empty > ok”.
now just one more; what is the name of the article table? ‘cause there is no simple txp_article or such like. can you tell? :)
sorry for asking noobie questions :P
thanks again!
Offline
#8 2006-02-02 15:01:17
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: delete all images and reset image number without doing each one
now just one more; what is the name of the article table? ‘cause there is no simple txp_article or such like. can you tell? :)
It’s the ‘textpattern’ table.
Offline
Re: delete all images and reset image number without doing each one
ah simple as that. and then just the usual id-box tick off, and the empty button i suppose.
thanks doggiez and theonlydrew! :)
Offline
Re: delete all images and reset image number without doing each one
Yep, it’s quite simple once you’ll get the “fear of SQL” out of the way. Still, be sure to always keep a minimal amount of fear… aka, make backups before messing with things. You’ll never know :)
Offline