skip to Main Content

I am looking to alter a db table.

I want to alter the table specifically the row membership_id, status varchar(20), and a change the end date.

This is wp_pmpro_memberships_users table if anyone is familiar.

I want to keep the same membership_id which is 9 but update the status from expired to active and give it a new end date

Any help appreciated.

Cheers

J

2

Answers


  1. Chosen as BEST ANSWER

    Thanks Ryan, this was to alter more than 1 row though.

    I used....

    UPDATE wp_pmpro_memberships_users SET status = 'active' WHERE membership_id = 12;

    UPDATE wp_pmpro_memberships_users SET enddate = '2021-04-17 15:00:00' WHERE membership_id = 12;

    Which worked :)

    However I now want to move alter membership_id = 12; to membership_id = 21;

    287 rows in this so doing one by one would take ages, there must be an alter to do this?


  2. If your host has it available, you can edit the database directly using phpmyadmin. It is pretty common software if you are running a cPanel host. I would recommend taking a backup of your database before making alterations directly. But you can:

    1. Select the database
    2. Select the wp_pmpro_memberships_users table
    3. Find the correct row and edit
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search