Okay
  Public Ticket #2749093
Error in logs
Closed

Comments

  • Admin Democratest started the conversation

    Hello

    The plugin is generating this error 

    2021/04/13 17:58:55 [error] 60525#60525: *151949 FastCGI sent in stderr: "PHP message: Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 de la base de datos de WordPress para la consulta SELECT COUNT(*) as cnt_total FROM  realizada por do_action('wp_ajax_get_wdtable'), WP_Hook->do_action, WP_Hook->apply_filters, wdtGetAjaxData, WPDataTable->queryBasedConstruct" while reading response header from upstream, client: 162.158.158.207, server: democratest.com, request: "POST /wp-admin/admin-ajax.php?action=get_wdtable&table_id=30 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "democratest.com", referrer: "https://democratest.com/citas-internas-externas/"

    No reconozco que la consulta SQL que da error sea de las que yo he escrito

    Best regards

  •  2,507
    Aleksandar replied

    Hello there.

    Can you please share more details about how this table is being created? 

    It looks like there's an issue with the SQL query and the PHP SQL parser we use, but it's also referencing some hooks, so I don't know if you added any hooks yourself, or is this coming from the plugin.

    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

  • Admin Democratest replied

    Hello

    This is the query of the wpdatatable

    SELECT *
    FROM (
    SELECT providerUserId, bookingStart, test ,barCode, Nombre, Apellidos, DNI, pasaporte, fechaNacimiento, sexo, telefono, email, sintomas, motivo, 'INTERNA', nota FROM dtProcesarAct
    UNION
    SELECT providerUserId, dtProcesarMan.dtCreated AS bookingStart, test, barCode, Nombre, Apellidos, DNI, pasaporte,fechaNacimiento, sexo, telefono, email, sintomas, motivo, 'EXTERNA', nota FROM dtProcesarMan
    ) AS TODAS

    It can be filtered by all the fields.

    I think that is the record counter. Mine displays:
    Showing records 1 to 25 from a total of 13,019 records (filtered from a total of NaN records)

    Best regards

  •  2,507
    Aleksandar replied

    Hello there

    The PHP SQL Parser we use has issues when you're using JOIN, UNION, CONCAT and sub-queries, so I guess that's causing the issue on your website.

    You would need to rewrite your query so it doesn't include a sub-query, and then 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 of 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, the server-side processing feature adds this part of the statement automatically when users trigger the sorting on the front-end, and having it in the initial statement may cause the table to crash.

    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