Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-11-17 01:44:21

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Reset the image IDs

How can I reset the image IDs so that it starts at 1 again? I suppose this must be done via the database.

Offline

#2 2020-11-17 07:17:35

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Reset the image IDs

Hi,

Yes you can do it on the DB directly, go to phpMyAdmin select the txp_image table, go to the “Operation” tab (right side of the screen), scroll a little down and you will find the AUTO_INCREMENT value, put it to 1 (or maybe 0 i dont know) to begin again, but dont forget to empty the image folder where all images are stored.

Cheers.

Offline

#3 2020-11-18 04:57:20

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Reset the image IDs

Many thanks. In my current case this worked with the AUTO_INCREMENT value 1, because I wanted to replace all 12 images anyway. But if there would be a lot of photos, a method would be better that does not need to delete the photos.

Offline

#4 2020-11-18 07:54:29

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Reset the image IDs

GugUser wrote #326897:

Many thanks. In my current case this worked with the AUTO_INCREMENT value 1, because I wanted to replace all 12 images anyway. But if there would be a lot of photos, a method would be better that does not need to delete the photos.

Hi,

If you wanted to only replace some photos why not use textpattern/image tab as usual ?

if you reset the images ID txp will try to put the image as 1.jpg and if there is an image in the folder either it replace it or throw an error message (havent tryed that).

Cheers.

Offline

Board footer

Powered by FluxBB