Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3373787
Searching/Filtering Do Not Work
Closed

Comments

  • PCN Web started the conversation

    Simple SQL-query based table displays all data correctly, but search and filtering do not.

    Attached files:  create_statement.txt

  • PCN Web replied

    Also, entering a SQl query in the message field of a ticket causes it to fail with a blank modal in your ticket system - this plugin is not off to a good start.

  • PCN Web replied

    The plugin is constructing invalid SQL:
     SELECT SQL_CALC_FOUND_ROWS * FROM mytablename.fin_report WHERE `mytablename.fin_report`.`ann_month` LIKE '%s2%' ORDER BY `ID` ASC LIMIT 10

    The correct SQL:
    SELECT SQL_CALC_FOUND_ROWS * FROM mytablename.fin_report WHERE mytablename.fin_report.ann_month LIKE '%s2%' ORDER BY ID ASC LIMIT 10

    works fine - how do I remove the backticks from your query?

  • PCN Web replied

    The table I'm querying is in the same database as the WordPress table - will this plugin only allow searching/filtering if the table is in the WordPress table? If so, can I add a VIEW to the WordPress table to make it work?

  •  1,692
    Miloš replied

    Hi, PCN Web.

    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.

    -

    Our plugin is not the same as a Database Management Tool and is not meant to be used as one.

    More details on how our plugin runs the SQL feature, as we pointed out some of the limitations in this Documentation :

    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, and search may not work properly if you include:

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

    -

    So, first you can check for accent graves around the table name, if you have this, remove it...

    Then, see if you used CONCAT to create any column.

    If so, go into this column setting, and disable it from "global search" in the Filtering tab.

    -

    7138515403.png

    -

    If none of that helps,

    you can try preparing a MySQL view (which will return the data that you need, call it e.g. “view1” and then build a wpDataTables based on a simple query like "SELECT * FROM view1″.

     If you need help with that, you can see our video, where we show an example of using View in our plugin.

    -

    Let me know If that helped.




    2. In regards to passing a specific direct SQL Query to Ticksy, the ticketing system,

    this is not owned by us - we just use it as our Support Platform.

    But we will notify the Ticksy Administration, and they will check about that fail with a blank modal in your ticket system, as you described.



    3. In regards to your question, does the Database Table need to be on same DB as WordPress, it depends what your use-case is.


    Our plugin has the feature for adding multiple DB Connections, if you need to pull data from tables other than the WP DB.

    You can connect the plugin to almost any MySQL, MSSQL, and PostgreSQL database using the Separate DB Connection section in wpDataTables, 

    if you correctly input the details for the connection.

    You first have to check if you have the following drivers installed, and activated.

    3838527468.png

    These drivers need to be installed and activated on the server where your WordPress website is. 

    After you install and activate those drivers, it should work.

    If you're not sure how to install the drivers, please reach out to your hosting provider.

    The server to which wpDataTables is connecting has its own method of establishing the connection, and we're using PHPs logic of connecting to separate connections.

     If there are errors your server returns, those are returned by the server, and only displayed by wpDataTables

     - there's no additional log within wpDataTables that would distinctively show you what's behind the error.


    4. If you ever need to combine data from multiple Databases in one SQL table,

    Starting from the version 2.3 you can connect to multiple separate database connections, and you can make tables from each database but at the moment is not unfortunately possible to join them directly.

    You could solve this in some of the cases by using the foreign key functionality and configuring table relations, this way you would be able to pull data from one table and show it in another, even if the tables use different databases as the data sources.

    If you would like to create a query with JOINs, and the tables are in different databases, but on the same server, you could use a MySQL view that would be generated based on a stored query using the database.table.field syntax, e.g. something like this is described here.

    If the servers are physically separated, our suggestion is to create a PHP script that would pull the data from all of the remote databases into a single one, and run scheduled e.g. once per hour.  You could then use the generated table to create a wpDataTable based on that.

    Read more about our plugin features in the documentation.

    -

    I hope this helps.

    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

  • PCN Web replied

    For future searchers - so this plugin does not work with a table that is outside the "WordPress" home table out of the box, it creates an invalid SQL query for the filters when that is the case, as you can prove by tailing your server log. In my case, I can move the table to the WordPress db for now, but I'll test a view to the other table as well.

    If I get time, I'll submit a fix - or ping me if you get them a patch in the interim.

  •  1,692
    Miloš replied

    Hi, PCN Web.

    I am sorry, but i did not understand your statement fully.

    When you say :

    'a table that is outside the "WordPress" home table',

    i guess you mean to pull an SQL Table that is not in the same Database as your WordPress Database.

    -

    This is not a bug, thus no fix is needed, that is just how our plugin works.

    ( As we previously pointed out, our plugin is not the same as a Database management Tool, it has certain limitations and everything goes through a PHP & SQL Parser)

    If the database you are pulling the Query from is the same one as your WordPress Database,

    then you can just make an SQL Query and it should pull the data you need.

    ( If the Query does not surpass our Parser limitations, in which case you can modify it or place it in a VIEW)

    -

    But If it is another database ( outside of WPDB) , even on the same DB server/connection, we still need to add it in our Plugin as an "external Database connection".

    There is a workaround if you need to combine data from multiple Databases in one SQL table ( check my point number 4 in the Reply).

    -

    So i am not sure what fix you are referring to, or a patch, but we will do our best to help/advise, let us know if anything is still unclear on how our SQL Logic works.

    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