Okay
  Public Ticket #2885242
Error when trying to change front line edit to different type
Closed

Comments

  • Yaron Ben-Shabat started the conversation

    i have a string(text) field, and i've allowed it to be edited in the front page, but, when i change the Editor input type to single value select box i get the below errors:

    There was an error while trying to save the table! parsererror

    WordPress database 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 '; ) tbl WHERE 1=1 ORDER BY (`status`) LIMIT 10' at line 1]
    SELECT DISTINCT(`status`) AS `status` FROM ( SELECT * FROM wp_schools ORDER BY created DESC; ) tbl WHERE 1=1 ORDER BY (`status`) LIMIT 10

    WordPress database 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 '; ) tbl WHERE 1=1 ORDER BY (`status`) LIMIT 10' at line 1]
    SELECT DISTINCT(`status`) AS `status` FROM ( SELECT * FROM wp_schools ORDER BY created DESC; ) tbl WHERE 1=1 ORDER BY (`status`) LIMIT 10

  • [deleted] replied

    Hi Yaron

    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.
  •   Yaron Ben-Shabat replied privately
  • [deleted] replied

    Hi Yaron

    Please remove the semicolon at the end of the query and let me know the result.

  • Yaron Ben-Shabat replied

    Okey, worked, but i have another question, for the editing i want Predefined value(s) dropdown but not from existing values values that i can add/edit the only option i can see is what in the DB

  • Yaron Ben-Shabat replied

    never mind, found it.

    Thanks

  • [deleted] replied

    Hi Yaron

    Thank you for reaching out to us, we are glad to hear you were able to find the solutionsmile.png

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

    Have a wonderful day!