Okay
  Public Ticket #1019604
SQL Comparison Operator
Closed

Comments

  •  2
    Hades85 started the conversation

    This comparison operator doesnt work < or <=  in your mysql query box.

    Try other operators like > or >= or = works fine.

    Same statement i try on same database with phpadmin everything works perfectly.


    wpDataTables backend error: No data fetched!
    Rendered query: SELECT id FROM player where id< 10 LIMIT 10

    MySQL said: 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 '10 LIMIT 10' at line 1
    This usually happens when the MySQL
    query returns an empty result or is broken. Please check the results of
    the query in some DB manager (e.g. PHPMyAdmin)

    Attachment shows you that i have more than 10 ids
  •  2
    Hades85 replied

    At the moment i use the BETWEEN Operator

  • [deleted] replied

    Hi Hades85,
    Thank you for your purchase.

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check PRIVATE and nobody can see it except us.

  •  2
    Hades85 replied

    Hello Milos,

    can i send you my tables as csv or sql? Would be easier for me.

    Also i found another "bug" it seems match is a keyword. One of my tables named "match" and your query box shows me an error same like in my first post.


  • [deleted] replied

    Hi Hades85,

    Yes you can send me dump of MySQL table. Also please send me MySQL query that you was using to create wpDataTable from that table from database or you tried to create wpDataTable with wpDataTables constructor?

  •  2
    Hades85 replied

    Hi,

    added the dump as attachment. The queries i used are very simple they also included as textfile in my zip.

  •  2
    Hades85 replied

    And could you find my issues?

    Another question placeholders are only useable for tables not for charts? If yes do you implement such a feature in future?

  • [deleted] replied

    Hi Hades85,

    In file ../wp-content/plugins/wpdatatables/controllers/wdt_admin_ajax_actions.php on line 221 find:

    $table_content = sanitize_text_field($_POST['table_content']);

    and replace it with

    $table_content = $_POST['table_content'];

    and < operator will work. Thank you for discovering this issue.

    In which way do you want to use placheholders in charts? You can create MySQL table using placeholders and from that table you can create chart.


  •  2
    Hades85 replied

    Thank you for your help.

    something like this doesnt work for me:
    [wpdatachart id=12 var1= hades]

    only with tables it works fine:

    [wpdatatable id=7 var1= hades]


    EDIT: It looks like the Var1-3 Variables will delete after second refresh. When i am save my table with the placeholder var1=String first preview after save action works fine. When im refresh my site and go to editor of tables all placeholders(var1-3) are deleted. Second preview action gives me an error because of no placeholders.

  • [deleted] replied

    Hi Hades85,

    It's not possible to use variables in shortcodes for chart, but if you create chart from a table that use variable and enable follow table filtering it will respect that variable from table shortcode.

    "EDIT: It looks like the Var1-3 Variables will delete after second refresh. When i am save my table with the placeholder var1=String first preview after save action works fine. When im refresh my site and go to editor of tables all placeholders(var1-3) are deleted. Second preview action gives me an error because of no placeholders."
    Please send me the ID of the table where this issue happens.