Okay
  Public Ticket #2819708
Search
Closed

Comments

  • Todd started the conversation

    I've added a simple SQL-driven table to a page, but the search mechanism does not seem to work.

    https://blog.proracquetballstats.com/index.php/pb-rankings-from-db-womens-pro-combined/

    This is a simple example.  However anything I type into the search bar returns no rows.  

    How does this search work and what is it searching for by default?  is this a database-driven search or is it searching the table after it has been retrieved and displayed on the wordpress page?

    Any help is appreciated.

  • [deleted] replied

    Hi Todd

    Thank you for reaching out to us.

    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.

  • Todd replied

    Hi all; i have discovered the root cause here; it is the presence of a databasename.tablename in my from clause.  By eliminating that in my queries, i'm able to get searching done.

    Thanks Blazenka for pointing me in the right direction.

  • [deleted] replied

    You are most welcome, I am glad to hear you were able to resolve the issuesmile.png

    If there is anything else we can assist you with please don't hesitate to open a new ticket.

    Have a wonderful day!