[Plugin: Participants Database] Reset Id number
Is it possible to reset the ID number to 1
Yes, at the moment, it requires that you edit the main file…but it will only work if you don’t have any records in your database. You’ll need to do a fresh install (that means deleting everything!) so it’s only a good idea if you don’t have any records stored.
I want to add the ability to reset them (that is, to renumber them from a new starting number) but that’s in the future.
Thats great. I only have a few test records in database at minute. Could you please tell me where exactly I can change it. Would be extremely grateful. Thank You. Fantastic Plugin.
I think I found it.
// record ID numbers begin counting up from this number
public static $id_base_number = 1325;
If I reset this to 1 will this be reset to 1325 every time there is an upgrade?
Yes, that the one. But this will only work if you completely delete the database. (or, if you you know your way around PHPMyAdmin, you can change the ID of the default record to whatever your want the initial ID to be)
The plugin requires that the first record in the main database have the same ID as the base ID number. If you delete the database, it will rebuild it starting with whatever your set that number to be
Warning: this is untested. There may be other problems. And an upgrade will change it, but you won’t have to rebuild the database, just change the $id_base_number again.
By completely deleting the database, you mean only the participants_database table, all the tables, or the whole wp installation?
I have changed the id base number to 1, and changed the id in the table record, but its giving me unexpected results, like if I set the (only) participant record I have to 1, when I go to the signup page it shows the data of that participant. But if I change it to 0, its fine, yet when I submit another entry, it continues from where it left off (1330 or so).
What do you think?
No, don’t delete your entire database…just the plugins database. The easiest way to do that is to deactivate it, then click on “delete” and it will delete the files and database for you. Then reinstall the plugin from scratch. Now you can make you mods before you create your first record. Remember the first record is the default record, so it has to be there and it needs to have the same ID number as the number you want to start your count with.
I don’t remember if what you told me worked, or if I had to go to the actual database and manually make changes for this to work, but in the end… it did work!
Now, a few months after this, I am coming back to a new installation, only to find out it also starts at 1325.
It would be nice if for future versions of this plugin this could be updated though.. (so it always starts at 1). Or maybe a button somewhere on the admin that says “reset ID count” to the last available number.
Anyway thanks again for the plugin!
- The topic ‘[Plugin: Participants Database] Reset Id number’ is closed to new replies.