Okay
  Public Ticket #3066932
Message in table footer
Closed

Comments

  • Ernie started the conversation

    Have this message at the bottom of my table:

    Showing 1 to 10 of 13 entries (filtered from NaN total entries)

    I'm not sure why it shows 'NaN' instead of an actual number when it knows there are 13.  Can I fix this or otherwise suppress it?

    Thanks.

  •  1,667
    Miloš replied



    Hi, Ernie 

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    I can see what you mean on the provided page, quite odd. I am not able to locally replicate this on my test sie.

    Please provide me a temporary WP-admin (administrator) user 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 parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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

  •   Ernie replied privately
  •   Miloš replied privately
  • Ernie replied

    I haven't yet locked down the site, so the normal WP login page is in play:


    https://sitezinc.com/wp-login.php

  • Ernie replied

    I haven't heard from you about this issue.

  •   Ernie replied privately
  •  1,667
    Miloš replied

    Hi, Ernie 

    Firstly i apologise for all the waiting time.

    I investigated the SQL query, and to be honest, i can't put my finger on it, but i am pretty certain that the root of the issue is there,  seems that our SQL&PHP parser is not processing something from your Query properly, thus is giving that odd "number of rows" at the bottom.

    -

    3163619479.png


    I made a little Test table just to see if this issue is happening on all of your tables;  and it is not the case, for this Manual table, i can properly see "showing number of entries" at the bottom, because it is pulling data directly from this new table in the database made by the plugin.

    1650622610.png

    -

    In some situations, using certain functions within SQL, the wpDataTables server has problems with parsing the query and building new queries dynamically (rarely happens, but does sometimes).

    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.

    Filtering, sorting, calculation functions and search may not work properly if you include:

    Accent graves ( ` ) around the table name JOIN functions UNION functions CONCAT functions sub-queries -

    • 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.

    -

    Usually to avoid this,  we 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″.

    - If you need help creating a View and use it with our plugin, here is our video with an example.


    -

    But, since you have sub-queries here, a single View won't work...

    You would have to combine multiple Views, and in the end call them in our plugin as a simplified SELECT statement.

    Can you please check out this example from Stack Overflow, on how to join multiple Views together https://stackoverflow.com/questions/33568147/how-to-join-two-views-in-single-view-in-sql

    Let me know if that helped?

    Then in the end, if you can place everything in a joined View, and call it in wpDataTables as 

    “SELECT * FROM JoinedViewName″

    In the meantime, i will see if senior colleagues have any additional advise when they inspect your Query.

    Thank you for your patience.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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

  •  1,667
    Miloš replied

    Hi, Ernie

    Sorry for the delay

    I've been advised by senior colleagues.

    You will definitely need to 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″.

    - If you need help creating a View and use it with our plugin, here is our video with an example.

    Let me know how it goes. Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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