WordPress.org

Ready to get started?Download WordPress

Forums

Edit Any Table
[resolved] Unable to edit primary key field (3 posts)

  1. abouttheinn
    Member
    Posted 8 months ago #

    I have a simple table with a primary key on a unique text field. To my surprise, one of our users needed to change the value in this field, but in Edit Any Table it is not editable (the other fields are editable).

    This is a great plugin (thank you!), but it would be a big help if editing this field could be enabled.

    https://wordpress.org/plugins/edit-any-table/

  2. redeyedmonster
    Member
    Plugin Author

    Posted 8 months ago #

    Hi - it is unusual to change a primary key after it has been assigned. Edit-Any-Table requires a primary key to know which record to update or delete, changing the key will not work because Edit-Any-Table will no longer have a reference to the record to change. May I suggest that you make this text field a unique field rather than a primary key (if it is important that it is unique) and then create an auto incrementing primary key that Edit-Any-Table can use as the record reference. I hope this helps solve your issue.

  3. abouttheinn
    Member
    Posted 8 months ago #

    Yes, I realize it is unusual. I've tried your solution of adding an A-I ID field as primary key to see if the user will be able to manage with that. I know it is better DB practice, but once we expose ID numbers to them, best practices may change...

    Thanks again for your plugin, and your reply.

Reply

You must log in to post.

About this Plugin

About this Topic