I needed to record "created on" and "created by", so took help from this ticket
It worked for "created on" - ALTER TABLE `cpt_wpdatatable_1` CHANGE `createdon` `createdon` DATETIME DEFAULT CURRENT_TIMESTAMP;
But for "created by" this is giving syntax error in PhpMyAdmin - ALTER TABLE `cpt_wpdatatable_1` CHANGE `createdby` `createdby` INT(11) DEFAULT CURRENT_USER_ID;
Is there any chance that you know where to find similar queries? I was unable to.
For operational reasons on this particular table I cannot use the "Users see and edit only own data" option.
Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.
CURRENT_USER_ID is our placeholder, and SQL cannot recognize it.
I don't know if you're going to be able to make the User ID field be automatically entered, since we're using WordPress' user ID, and I believe you'd have to do a JOIN to pull in the data from wp_users table.
Why wouldn't it work? It uses the details of tables after they have been generated, so if you have a wpDataTable that displays the joined columns, they can also be used in Master-Detail.
We didn't do anything here. Like I said to Srinath, since we're using WordPress' user ID, you'd have to do a JOIN to pull in the data from wp_users table, since CURRENT_USER_ID is our placeholder, and it is not recognized by the database.
Hello Aleksandar
I needed to record "created on" and "created by", so took help from this ticket
It worked for "created on" -
ALTER TABLE `cpt_wpdatatable_1` CHANGE `createdon` `createdon` DATETIME DEFAULT CURRENT_TIMESTAMP;
But for "created by" this is giving syntax error in PhpMyAdmin -
ALTER TABLE `cpt_wpdatatable_1` CHANGE `createdby` `createdby` INT(11) DEFAULT CURRENT_USER_ID;
Is there any chance that you know where to find similar queries?
I was unable to.
For operational reasons on this particular table I cannot use the "Users see and edit only own data" option.
Thank you
Srinath
Hello again Srinath.
What error is it displaying?
Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.
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
Hi again Srinath
CURRENT_USER_ID is our placeholder, and SQL cannot recognize it.
I don't know if you're going to be able to make the User ID field be automatically entered, since we're using WordPress' user ID, and I believe you'd have to do a JOIN to pull in the data from wp_users table.
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
Hello again Srinath
Why wouldn't it work? It uses the details of tables after they have been generated, so if you have a wpDataTable that displays the joined columns, they can also be used in Master-Detail.
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
Hello Aleksandar
After seeing your reply, I tried again.
And it worked!!!
Thank you so much Aleksandar.
Srinath
You're welcome, Srinath
Glad I could help.
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
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
Good afternoon,
I'm very curious how the 'created by/moddified by CURRENT_USER' was solved, because I'm trying to do this exact same thing.
kind regards,
Edwin
Hello Edwin
We didn't do anything here. Like I said to Srinath, since we're using WordPress' user ID, you'd have to do a JOIN to pull in the data from wp_users table, since CURRENT_USER_ID is our placeholder, and it is not recognized by the database.
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