Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-06-25 20:04:40
- Mobilizing Mouse
- Member
- From: Vancouver, BC, Canada
- Registered: 2010-05-23
- Posts: 22
I deleted images instead of replacing them can I reset the image IDs?
Hi everyone
I’m just getting a photo gallery up and running
(with this excellent help: http://fuelyourcoding.com/easy-to-update-thumbnail-gallery-using-textpattern-and-galleriffic/ )
I uploaded a bunch of 120 photos, but then decided I didn’t want about 50 of them
So I deleted them, rather than replacing them
I hindsight I should have just let them sit, and replaced them over time with ones I did want to use
So I am up to the mid 140s and it would be nice to have consecutive numbers or close
Is there a way to get my 32 to 84 image IDs back?
A reset or something?
Thanks!
Stephen
‘I can’t understand why people are frightened of new ideas. I’m frightened of the old ones.’
John Cage
Offline
#2 2010-06-25 21:38:19
- RalphFFM
- Member
- Registered: 2008-10-05
- Posts: 40
Re: I deleted images instead of replacing them can I reset the image IDs?
As far as i know:
With TXP-tools or -funktions: no.
Probably yes with lower-level tools like phpmyadmin. (alter table … auto_increment=…)
But i would advice against it until you know mysql at least as good as your pocket!
Offline
#3 2010-06-25 22:03:42
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: I deleted images instead of replacing them can I reset the image IDs?
Keep in mind that if you change the IDs in the database, you also need to rename the images and thumbnails accordingly.
Offline
Re: I deleted images instead of replacing them can I reset the image IDs?
At first time using TXP I was frustrated by auto-increment of ids in articles and images. It was unclear that after deleting 5th article (or image) newly created has id=6, not 5.
But then I understood that it’s very useful – if you assigned some some article/image/other stuff with unique id to some object (e.g. assign images to articles) you shouldn’t worry that deleting old items will break you plans :)
If you want to use id counter, you probably should look at smd_query and use count(*)
mysql command
Last edited by the_ghost (2010-06-26 07:35:29)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#5 2010-06-27 17:36:33
- Mobilizing Mouse
- Member
- From: Vancouver, BC, Canada
- Registered: 2010-05-23
- Posts: 22
Re: I deleted images instead of replacing them can I reset the image IDs?
Thanks everyone for the ideas, reminders and tips.
So I can either continue with the static ID numbers and learn to enjoy them, or manually change numbers in the database, or get into scary ‘phpmyadmin. (alter table … auto_increment=…)’ stuff.
I think I’m going to keep the current set up for now, though I do feel a logical system would be if say ID# 56 is deleted, the next new image is given the now vacant # 56, rather than say #183
Thanks again for the responses
Take care
Stephen
‘I can’t understand why people are frightened of new ideas. I’m frightened of the old ones.’
John Cage
Offline