Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2300248
error when working with ACF plugin
Closed

Comments

  • Javier started the conversation

    Hi

    I would like to know how to solve this error

    ×CloseError! There was an error trying to insert a new row! Error: Unknown column 'empleado_post_title' in 'field list'

    It only appears when i pass to the mysql query data from ACF plugin and try to edit any field.

    I was looking in support forums about this and I have encountered this post

    https://tmsplugins.ticksy.com/ticket/1651310/ in which Milan says...

    "If you are using JOINS with more tables please note that in wpdatatables just one table can be editable at the moment"

    But as far as i know i am just using only one table. And the code was generated automaticly by the software.

    This is the query code...

    SELECT posts_empleado.ID AS empleado_ID,
           posts_empleado.post_title AS empleado_post_title,
           empleado_meta_fecha_del_masaje_tbl.meta_value AS empleado_meta_fecha_del_masaje
    FROM poa3_posts AS posts_empleado
      INNER JOIN (SELECT empleado_meta_fecha_del_masaje_tbl_posts.ID as id, meta_value, meta_key  FROM poa3_postmeta AS empleado_meta_fecha_del_masaje_tbl_postmeta  INNER JOIN poa3_posts AS empleado_meta_fecha_del_masaje_tbl_posts   ON empleado_meta_fecha_del_masaje_tbl_postmeta.post_id = empleado_meta_fecha_del_masaje_tbl_posts.ID   AND empleado_meta_fecha_del_masaje_tbl_posts.post_type = 'empleado') AS empleado_meta_fecha_del_masaje_tbl
         ON empleado_meta_fecha_del_masaje_tbl.meta_key = 'fecha_del_masaje' AND empleado_meta_fecha_del_masaje_tbl.id = posts_empleado.ID 
    WHERE 1=1 
       AND posts_empleado.post_type = 'empleado'

    May you help me with that please.

    Thanks very much

  • Javier replied

    I was testing in your sand box and aparently a similar problem is displaying.

    Is the table called test_19. It's a table very simple, just for displaying post's title. I made it editable. and when i try to enter a new entry, the error is displayed. (See image attached)

    And this is how the query is showing... I did it automatically  with the fourth icon "

    Generate a query to WordPress database.

    "

    SELECT posts_post.ID AS post_ID,
           posts_post.post_title AS post_post_title
    FROM wp_posts AS posts_post
    WHERE 1=1 
       AND posts_post.post_type = 'post'


    I dont know what i am doing wrong

  •  2,499
    Aleksandar replied

    Hello Javier

    Thank you for your purchase, and sorry for the late response. We're not working on weekends, and we had a non-working Monday due to a National Holiday.

    What Milan said is true about query with JOINs, and creating a view.

    Unfortunately, the query constructor is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.

    If this is your query:

    SELECT posts_post.ID AS post_ID,
           posts_post.post_title AS post_post_title
    FROM wp_posts AS posts_post
    WHERE 1=1 
       AND posts_post.post_type = 'post'
    

    You can simplify it:

    SELECT  ID,
            post_title
    FROM wp_posts
    WHERE post_type = 'post'

    And it should work fine. No need to include the table name if you're only pulling the data from one table.

    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

  • Javier replied

    Hi Aleksandar

    Dont worry about the delay, and thanks for your response.

    I understand what you are telling me, and for simple queries like the lastone is easy to change in order to work everything properly.

    But what I cant overcome, is the other one with avnced custom field and a custom post type.

    I was testing creating a custom post type from scratch by code, and with custom post type plugin and with both aproaches have the same problem.

    Once the query is created with the fourth image, the filter doesnt work, and the editing neither. Both only work if i disable "server side processing", but if i disable it i can't edit in the front end:((

    I was trying to modify the query following the structure you gave before, but it is a little more complex and i can't handle it.

    Could you tell what i shoul do?

    In this case, i have created a custom post type called 'empleado', and through Advanced custom fields i have created a date type field called 'fecha del masaje'. I made the query through the 4th option selecting empleado.ID, empleado.title and empleado.fecha del masaje and this is the query result

    SELECT posts_empleado.ID AS empleado_ID,
           posts_empleado.post_title AS empleado_post_title,
           empleado_meta_fecha_del_masaje_tbl.meta_value AS empleado_meta_fecha_del_masaje
    FROM poa3_posts AS posts_empleado
      INNER JOIN (SELECT empleado_meta_fecha_del_masaje_tbl_posts.ID as id, meta_value, meta_key  FROM poa3_postmeta AS empleado_meta_fecha_del_masaje_tbl_postmeta  INNER JOIN poa3_posts AS empleado_meta_fecha_del_masaje_tbl_posts   ON empleado_meta_fecha_del_masaje_tbl_postmeta.post_id = empleado_meta_fecha_del_masaje_tbl_posts.ID   AND empleado_meta_fecha_del_masaje_tbl_posts.post_type = 'empleado') AS empleado_meta_fecha_del_masaje_tbl
         ON empleado_meta_fecha_del_masaje_tbl.meta_key = 'fecha_del_masaje' AND empleado_meta_fecha_del_masaje_tbl.id = posts_empleado.ID 
    WHERE 1=1 
       AND posts_empleado.post_type = 'empleado'


    What should I modify in order to everything works.

    Thanks very much Aleksandar for your help.


  •  2,499
    Aleksandar replied

    Hi again Javier

    Unfortunately, I don't even know if we're going to be able to make this table editable. You see, 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.

    As for the query, writing custom queries isn't included in the provided support, but I'll gladly take a look at it, and see if there's anything I can do.

    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 Reply so nobody can see them except us.

    Also, please make sure to tell me what's the table's ID, so I know where to look.

    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

  • Javier replied

    Hi Aleksandar

    Thanks very much for your help.

    Just a couple of things...

    1º When you are telling me 'Queries from multiple tables with joins cannot be used as an editable feature'. Are you talking about tables from the tables created by wpdatatables plugin, or tables in the data base?

    Because in both cases are just one table. In case of wpdatatbles plugin is just one table and in the case of tables inside my database you must bare in mind wordpress save all data from advanced custom fields and from the custom post type that I have created from scratch by code, inside the table called 'whatever_posts'. Just one table as well.

    2º In second place i would like to tell you that i am working in local host with xampp. So i can create a copy of the site with the plugin  all in one wp migration and give it to you (It's for me the easiest one). Or if it is posible to create a site in your sandbox...you give me the credentials and i'll import there the site with the plugin.Or i'll have to upload the site to one server. Could you tell what is the best option for you Aleksandar?

    Thanks very much again. See you

  •  2,499
    Aleksandar replied

    Hi again Javier

    1. This is in regard to queries pulling the data from multiple DB tables. Since you have JOINS, and are pulling meta_values into specific columns, the plugin can't work well with it, as it is seen as a separate table in the query (bolded):

     SELECT posts_empleado.ID AS empleado_ID,
                    posts_empleado.post_title AS empleado_post_title,
                    empleado_meta_fecha_del_masaje_tbl.meta_value AS empleado_meta_fecha_del_masaje

    Simply, queries with JOINS don't allow the table to be editable in all cases. Sometimes it works, sometimes it doesn't. This is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (rarely happens, but does sometimes).

    2. I'd love to take a look. Can you, maybe, install the Duplicator Plugin, clone your website, and send me the two files it generates? Then, I can use it to create the website in my local environment, and see if there's anything I can do to help.

    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

  • Javier replied

    Hi Aleksandar

    Based on what you are telling me these days and knowing that everything in wordpress related with ACF plugin and custom post types is stored in the same table prefix_posts, I am making tests trying to pull data from this unique table selecting diferent columns, and so almost everything is running ok.

    And I prefer to do some new tests before boring you with more quetions. 

    Let me test some extra things in the weekend, and according to my results I'll give you my response.

    Thanks Aleksandar

  •  2,499
    Aleksandar replied

    Good deal Javier, thanks.

    I'll wait for your response, then. Happy testing!

    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

  •   Javier replied privately
  •  2,499
    Aleksandar replied

    Hi again Javier

    You can zip it all and upload to wetransfer.com. then just share the link with me, and I'll be able to fetch the files.

    Please include the duplicator files as well, so I can install the website in local environment and see what's going on

    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

  • Javier replied

    It's already done Aleksandar

    Tnkas very much

  •   Aleksandar replied privately
  •   Javier replied privately
  •   Aleksandar replied privately
  •   Javier replied privately
  •  2,499
    Aleksandar replied

    You're welcome, Javier

    If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.

    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