Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-14 00:51:12

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Database: Reset image ID #'s?

Hi,

Is it possible to reset the ID numbers of the uploaded images?

For example, I am almost finished on a small site where I uploaded placeholder graphics for testing purposes… Long story short, I use the image ID’s for template/display purposes… I plan on deleting the placeholder images (or replacing them) for client to use “real” images, but I think he will want to have images start at ID #1 (currently the lowest image ID is 3).

Does that make sense?

I figure I can delete the placeholder images, then use PHPmyAdmin to manually change the ID’s… but is there a better way?

I am not using txp for anything other than client images, so there are no uploaded template graphics.

Any tips would be great.

Cheers,
Micky

Offline

#2 2007-06-14 01:14:42

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Database: Reset image ID #'s?

ALTER TABLE txp_image AUTO_INCREMENT = 1;

That resets the next ID number to be used.

Offline

#3 2007-06-14 01:46:34

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Database: Reset image ID #'s?

Hi Mary, thanks for you quick reply, I really appreciate the hlep. :)

Ahhh! Great, thanks for tip on that one. I really appreciate it.

And thanks for all of your great plugins too! ;)

Have a great day.
Cheers,
Micky

Offline

#4 2007-06-15 21:22:00

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Database: Reset image ID #'s?

Hello, me again.

Sorry to be a total pain in the neck, but what would be the best approach for doing this?

1. delete all images.
2. ALTER TABLE (should I use PHPmyAdmin?)
3. Upload new images, where 1 will be the first ID used.

Thanks for any more tips you (or others) could give.

This might be a good thing for the WIKI.

Also, Mary, the Textpattern Solutions book is great! I got it in mail via Amazon yesterday. I just noticed your name on it — good work! :)

Cheers,
Micky

Last edited by mhulse (2007-06-15 21:23:20)

Offline

#5 2007-06-15 21:37:50

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Database: Reset image ID #'s?

Yes, that approach would work. PHPmyadmin is fine.

Offline

#6 2007-06-15 21:58:07

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: Database: Reset image ID #'s?

Great, thanks ruud! :)

Just wanted to double-check before doing… I get nervous when tinkering directly with DB.

Have a great day,
Cheers,
M

Offline

Board footer

Powered by FluxBB