working on the demo I can't find a way to filter by a count column. For example I am using this query:
SELECT id, employee_id, customer_id, order_date, shipped_date, shipper_id, ship_name, ship_address, ship_city, COUNT(id) FROM orders GROUP BY shipper_id
And I get correct results with 3 rows. But when I try to filter with an existing value (20) then I get no results but this information "Showing 1 to 10 of 10 entries".
Why is that? How I can fix it? Is there a way to proper filter count columns?
If your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (rarely happens, but does sometimes). To avoid this please prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled based on a simple query like “SELECT * FROM view1″.
Please note some this when working with the server-side processing feature:
Please do not use “LIMIT” in the SELECT statement. wpDataTables adds it automatically and it will be overridden.
Please do not use “ORDER BY” in the SELECT statement. wpDataTables has its own sorting engine so it makes no sense to use MySQL’s sorting, since it will be overridden. Also, server-side processing feature adds this part of statement automatically when users trigger the sorting on the front-end, and having it in initial statement may cause the table to crash.
Hello,
working on the demo I can't find a way to filter by a count column. For example I am using this query:
SELECT id, employee_id, customer_id, order_date, shipped_date, shipper_id, ship_name, ship_address, ship_city, COUNT(id) FROM orders
GROUP BY shipper_id
And I get correct results with 3 rows. But when I try to filter with an existing value (20) then I get no results but this information "Showing 1 to 10 of 10 entries".
Why is that? How I can fix it? Is there a way to proper filter count columns?
Hello Aggelos.
If your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (rarely happens, but does sometimes). To avoid this please prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled based on a simple query like “SELECT * FROM view1″.
Please note some this when working with the server-side processing feature:
Best regards.
Kind Regards,
Aleksandar Vuković
aleksandar.vukovic@tmsproducts.io
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