Okay
  Public Ticket #1661920
search not working
Closed

Comments

  • Tim Sheasby started the conversation

    When I try to search for a word that appears in a field I get no results at all.

    SQL is: 

    SELECT  p_ID AS ID, CONCAT(p_author, IF(p_initials IS NULL, "", CONCAT(", ",p_initials)), IF(p_others=1, " and others", "") ) AS Author, p_title AS Title, p_year AS Year, p_keywords AS Keywords, p_link
    FROM    ll_paper
    WHERE   p_access <= %VAR1%

    The p_access field lets me test whether the use has permission to view a specific file. I created my own shortcode to insert that value automatically. The selection and sorting work - but search and filter do not seem to accomplish anything. Will I have to write my own search routine to handle the search? Am already late delivering the product so need urgent help.


    UPDATE

    If I turn off server side searching it works so no worries for now.

  •  1,689
    Miloš replied

    HI Tim,
    Thank you for your purchase.

    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 (happens rarely, 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 triggers the sorting on the front-end, and having it in initial statement may cause the table to crash.


    Best regards.

    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