Change next id download

Phoca Download - download manager
hiteq
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 11 Jan 2019, 16:07

Change next id download

Post by hiteq » 11 Jan 2019, 16:11

Hello
i should reset dth number of id of download. So for 2019 they must start from 1.
I have open db and in "id" of _phocadownload i have set 1 into "AUTO_INCREMENT" the i have click on Run but i see always the same number. So what's wrong?
Thanks

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 40655
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change next id download

Post by Jan » 13 Jan 2019, 15:14

Hi, when you want to restart auto_increment values in your database, then the quickest method is to make

Code: Select all

TRUNCATE TABLE table_name;
But this will delete all data in the table, so before making it, the backup must be done. If you want to keep old data in database, there is no option to have two items with the same ID.

Jan
If you find Phoca extensions useful, please support the project

hiteq
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 11 Jan 2019, 16:07

Re: Change next id download

Post by hiteq » 14 Jan 2019, 15:47

Thanks for your replay. And do you thing it possible to add 2018, for example, to old download and reset the new? Thanks

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 40655
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change next id download

Post by Jan » 14 Jan 2019, 17:39

The problem is, it is auto increment so if you add e.g. 2018 to 123, so it becomes 2018123 - then the next number is 2018124 not 2019001, it is just database autoincrement number which cares about not adding two the same values into database.

Jan
If you find Phoca extensions useful, please support the project

Post Reply