Okay
  Public Ticket #2940580
MySQL queries
Closed

Comments

  • Inigh started the conversation

    Greetings!

    I recently purchased wpDataTables after careful consideration that it would meet a few advanced requirements of mine, in particular using a search form to render data from a database. However when I create my table linking to an existing data source and enter the mysql query it does note render the query as requested.

    Following is an example of the mysql query for NSE pricelist and you can find the result from another plugin in the URL above:

    SELECT `date`, `company`, `open`, `close`, `change`, `volume`, `value` FROM `pricelist2021` ORDER BY `date` DESC, `company` ASC LIMIT 103

    When I use wpDataTables plugin the result does not render beyond the SELECT statement. I really need MySQL queries to render correctly properly so I can also activate the other features of your plugin.

    I tried generate a query to the MySQL database to create my table but struggled trying to use conditions and grouping rules to get the result I required. Is there additional information or demos I can refer to in this case?

    Your urgent response will be appreciated. Thank you.

  •  1,851
    Miloš replied

    Hi, Inigh.

    Thank you for reaching out to us.

    Our plugin's logic for using SQL 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.

    Using variables ( @ ), stored procedures and nested queries is not supported.

    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

    Could you maybe 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″ ?

    Here is some more documentation regarding this - https://wpdatatables.com/documentation/creating-wpdatatables/creating-mysql-based-wpdatatables/

    Please contact us further if still not resolved, and we will follow up with urgency.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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