Hey there, Awesome Customers!
Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.
During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.
We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!
In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.
Thanks a bunch for your understanding and support!
Catch you on the flip side!
Warm regards,
TMS
When creating a new table from an SQL query. I get the below error
There was an error while trying to save the table! OK
Notice: Undefined index: table in /var/www/html/dev/wp-content/plugins/wpdatatables/source/class.wpdatatable.php on line 1638
Notice: Trying to get property 'pos' of non-object in /var/www/html/dev/wp-content/plugins/wpdatatables/source/class.wdtconfigcontroller.php on line 780
{"table":{"_cacheHash":"","connection":null},"error":"Column 'pos' cannot be null"}
Tested the below SQL query in mysql and was able to generate results correctly.
SELECT
IFNULL(grc,'NO GRC') AS grc,
SUM(num_participants) as numparticipants,
SUM(num_participants)/(SUM(SUM(num_participants)) OVER ())*100 AS pcparticipants,
SUM(IFNULL(scj_completed,0)) AS scjcompleted,
SUM(IFNULL(scj_not_completed,0)) AS scjnotcompleted
FROM
(
SELECT
grc,
COUNT(*) as num_participants,
SUM(CASE WHEN scj_status = 7 OR scj_status = 8 THEN 1 ELSE 0 END) as scj_completed,
SUM(CASE WHEN scj_status != 7 AND scj_status != 8 THEN 1 ELSE 0 END) as scj_not_completed
FROM
wp_scj_participants
LEFT JOIN wp_scj_grcmap ON wp_scj_participants.postal_code = wp_scj_grcmap.postalcode
WHERE
scj_status IS NOT NULL
AND (1=1 OR aip_date BETWEEN '%VAR1%' AND '%VAR2%')
GROUP BY
wp_scj_grcmap.grc
) a
GROUP BY grc
ORDER BY num_participants DESC
grcnumparticipantspcparticipantsscjcompletedscjnotcompletedNO GRC6161.0000160JALAN BESAR1111.0000110DUMMY GRC88.000008MARINE PARADE77.000007EAST COAST55.000014ANG MO KIO22.000002ALJUNIED22.000002SEMBAWANG22.000020TANJONG PAGAR11.000001TAMPINES11.000001Hello Alvin
Our logic is based on a PHP SQL parser which has full support for the SQL dialect for the following statement types
SELECT, INSERT, UPDATE, DELETE, REPLACE, RENAME, SHOW, SET, DROP, CREATE INDEX, CREATE TABLE, EXPLAIN and DESCRIBE.
Some of them are disabled for security reasons.
You can try preparing a MySQL view (which will return the data that you need, call it e.g. “view1” and then build a wpDataTables based on a simple query like "SELECT * FROM view1″.
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 Aleksandar,
Do you know which part of the query I provided was causing the error? From what I see the functions I used are not blocked, as I have another query with SELECT, COUNT, SUM, IFNULL.
I can't say exactly what caused the issue, but it could be COUNT(*) or by using GROUP BY.
Please note some this when working with the server-side processing feature:
When working with more complex queries, it's always better to create VIEWs in the database, and then pull them to create a 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
Noted on this, we'll try to put that in views if it becomes overly complex.
Thanks Alvin
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