You could set up a new table (for example, name it "user_database") which would contain the user's unique ID and add their name there. Then, you can set up your original table to pull the name from the "user_database" using Foreign Keys.
May be I'm doing something wrong, but this don't work.
I have made a table "UserTable" filled by the SQL query: select ID,user_nicename from wp_users;
I have made a table where editing is allowed only for a person, who added a row, a column UID is auto-filled by the user ID. After that I have changed column "UID" type to "String" (mandatory to use a foreign key) and configured a foreign key with the following relation: UserTable (id: 5), Show column: user_nicename, Value from column: ID.
I don't know why it's not working for you. Let's go through it step by step.
You created a table in PHPMyAdmin which has the user's name and each user has his unique auto-increment ID. Something like this:
Then you would need to create a manual table in a similar way the table was created in our documentation:
And the table is set up like this:
Now, you can see I already set up the "User ID" column to be a Foreign Key, since it's showing the last name from SQL (Bedecs, for Anna in the first row).
Since I am doing this in local environment, I can only add myself, so it's only pulling the "1" value.
Is it possible to display full user name (who added the row) in a column, instead of WP user ID?
Hello Hemml.
Thank you for your purchase.
You could set up a new table (for example, name it "user_database") which would contain the user's unique ID and add their name there. Then, you can set up your original table to pull the name from the "user_database" using Foreign Keys.
I hope this helps.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
May be I'm doing something wrong, but this don't work.
I have made a table "UserTable" filled by the SQL query: select ID,user_nicename from wp_users;
I have made a table where editing is allowed only for a person, who added a row, a column UID is auto-filled by the user ID. After that I have changed column "UID" type to "String" (mandatory to use a foreign key) and configured a foreign key with the following relation: UserTable (id: 5), Show column: user_nicename, Value from column: ID.
But the table still show numbers in column UID.
Hi again Hemml.
I don't know why it's not working for you. Let's go through it step by step.
You created a table in PHPMyAdmin which has the user's name and each user has his unique auto-increment ID. Something like this:
Then you would need to create a manual table in a similar way the table was created in our documentation:
And the table is set up like this:
Now, you can see I already set up the "User ID" column to be a Foreign Key, since it's showing the last name from SQL (Bedecs, for Anna in the first row).
Since I am doing this in local environment, I can only add myself, so it's only pulling the "1" value.
Please let me know if this helps.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables