Okay
  Public Ticket #1911221
Updating to wp_postmeta
Closed

Comments

  • gjindancer started the conversation

    I'm querying wp_posts and joining LEFT from wp_postmeta

    I only want the wp_postmeta table to be editable though  - is this possible?

    I'm specifying wp_postmeta as the table that can be edited and 'my_column' is successfully displayed in the table

    Currently I get:

    There was an error trying to update the row! Error: Unknown column 'my_column' in 'field list'

    when I try to edit even though the field exists in the table

    The only thing I can thing of is that we are referencing post_id from wp_posts as the incremental integer.

    I think I'm missing something rather than your plugin not being able to do this?

    Thanks

    Dan


  •  2,572
    Aleksandar replied

    Hello Dan.

    Thank you for your purchase.

    Please note these limitations on editing tables with wpDataTables:

    • Only one MySQL table can be edited at a time. Queries from multiple tables with joins cannot be used as an editable feature, since SQL UPDATE and INSERT statements are generated automatically, and there currently is no way to update multiple tables – but this problem is being investigated and pursued.
    • Only MySQL tables or tables created with “Create a table manually” and “Create a table by importing data from data source” options of “Create a Table” page can be edited.
    • Server-side processing MUST be turned on for front-end editing – Note: It will turn on automatically if you forget to enable it.
    • MySQL Views cannot be edited properly – only one of the underlying tables can be edited if you pass the proper ID.

    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.

    Please let me know if this helps.

    Best regards.

    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