1. You create a table via "Generate a query to MySQL database."
2. You select a table (can be any table), and select a column/field (any field).
3. In the next step the magic happens; you get an SQL statement that the plugin generated for the prev selections (most likely it would not be what you want/need), and here you can paste the SQL statement that you want !!! here you can write whatever you think of - after testing it in phpMyAdmin.
example:
SELECT wp_wpdatatable_1.`lastintro`, wp_wpdatatable_1.`wdt_ID`, wp_wpdatatable_1.`userid`, wp_wpdatatable_1.`firstaname`, wp_wpdatatable_1.`lastname`, wp_wpdatatable_1.`email`, wp_wpdatatable_1.`whatsapp` FROM wp_wpdatatable_1 LEFT JOIN wp_users ON (wp_wpdatatable_1.userid=wp_users.ID) WHERE wp_users.ID is null
Thank you for letting me know how you got the desired result. I'll be checking that out, and I'll forward it to our development team, so they can test it. If they confirm this, they will probably be able to remove the limitation from the basic SQL Query window.
Aleksander hi,
I have the tables and can edit each user his own records.
There are times that a user is being deleted from the system, however the records he added to wpDataTables remain as orphans.
I reached a query that I can find these records.
SELECT * FROM wp_wpdatatable_1 LEFT JOIN wp_users
ON (wp_wpdatatable_1.userid=wp_users.ID)
WHERE wp_users.ID is null
The question is how can I implement it with the plugin.
I tried but could not find the "is" word in the options.
Please advise.
BR,
Arie
Hi again Arie.
By default, wp_users table cannot have any NULL values:
It's structure simply doesn't allow that. If you changed the structure, then I guess it would be possible, and if so, you can try with this:
So instead of "is" use "=" and add the single quotes around the value.
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
Aleksander hi,
I did not change the wordpress database.
... is null and ... = 'null' are different; the later is when there is no field/match at all.
I found another way to handle it since is required the sql IS.
Thanks
Arie
Hello again Arie.
I'm glad to hear you found a way to make it work.
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
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
Aleksander hi,
I found a better way using the plugin.
1. You create a table via "Generate a query to MySQL database."
2. You select a table (can be any table), and select a column/field (any field).
3. In the next step the magic happens; you get an SQL statement that the plugin generated for the prev selections (most likely it would not be what you want/need), and here you can paste the SQL statement that you want !!! here you can write whatever you think of - after testing it in phpMyAdmin.
example:
SELECT wp_wpdatatable_1.`lastintro`,
wp_wpdatatable_1.`wdt_ID`,
wp_wpdatatable_1.`userid`,
wp_wpdatatable_1.`firstaname`,
wp_wpdatatable_1.`lastname`,
wp_wpdatatable_1.`email`,
wp_wpdatatable_1.`whatsapp`
FROM wp_wpdatatable_1
LEFT JOIN wp_users ON (wp_wpdatatable_1.userid=wp_users.ID) WHERE wp_users.ID is null
Here 'is null' is accepted and works fine !
BR,
Arie
Hey Arie
Thank you for letting me know how you got the desired result. I'll be checking that out, and I'll forward it to our development team, so they can test it. If they confirm this, they will probably be able to remove the limitation from the basic SQL Query window.
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