Okay
  Public Ticket #2067609
Showing wrong info in "filter from XXX"
Closed

Comments

  • hulabula started the conversation

    The SQL Query is returning the correct info and returning a total of 4 items.  All correct.  BUT the bottom table info is showing this...

    "Showing 1 to 4 of 4 entries (filtered from 531 total entries)"

    And it's showing the same for any and all tables I make, regardless of the actual number of results the SQL turns up, 4 or 64.  I also can't figure out where the 531 number comes from.

    Thoughts as to what's going on and/or how to fix this?

    Thanks!

  •  2,572
    Aleksandar replied

    Hello hulabula.

    You're actually applying the filter through the query, so instead of pulling all data from pcs_posts, you're pulling only the CONCAT function, where post_type = 'project' and post_status='publish'.

    There are probably 527 more rows that are being filtered out because of the WHERE clause.

    Maybe you can try creating a MySQL VIEW in PHPMyAdmin, using the same query, like this:

    CREATE VIEW view1 AS SELECT
    CONCAT............
    FROM pcs_posts AS posts_projects
    WHERE 1=1
    AND posts_project.post_type = 'project'
    AND posts_project.post_statys = 'publish'

    Then you can create a table in wpDataTables like:

    SELECT * FROM view1

    And it will display only those 4 results.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [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