Okay
  Public Ticket #2788880
Erreur while add or edit row
Closed

Comments

  • Mel started the conversation

    Hi, 

    I am encountering an issue while I try to add or edit rows in my table, connected to my Wp database. 

    Here's the message error:  Erreur: Unknown column 'project_ID' in 'where clause'

    I don't understand what the problem is. Do you have any idea? 

    Thanks for your help!

  • [deleted] replied

    Hi Mel

    Thank you for reaching out to us.

    Could you please provide us with some more details on the issue, how was the table created, if this is an SQL table please send us the query so we can test this locally?

    If you have any screenshots or a screen recording of the issue that would be helpful as well.


  • Mel replied

    Hi, 

    Thanks for your answer. Yes, it is a SQL table, the queries based on the Wordpress database. 

    You can see the issue here : 

    I am using ACF fields + the custom post type "project" from Divi. Thanks again!

    SELECT posts_project.ID AS project_ID,
           posts_project.post_title AS project_post_title,
           posts_project_author.display_name AS project_post_author,
           project_meta_signataires_tbl.meta_value AS project_meta_signataires,
           project_taxonomy_langue_originale_tbl.name AS project_taxonomy_langue_originale,
           project_meta_titre_du_manifeste_en_anglais_tbl.meta_value AS project_meta_titre_du_manifeste_en_anglais,
           project_meta_premiere_publication_tbl.meta_value AS project_meta_premiere_publication,
           project_taxonomy_mouvements_en_langue_tbl.name AS project_taxonomy_mouvements_en_langue,
           project_taxonomy_mouvement_en_anglais_tbl.name AS project_taxonomy_mouvement_en_anglais,
           project_meta_mouvement_langue_originale_tbl.meta_value AS project_meta_mouvement_langue_originale,
           project_meta_mouvement_anglais_tbl.meta_value AS project_meta_mouvement_anglais,
           project_meta_domaines_dappartenance_tbl.meta_value AS project_meta_domaines_dappartenance,
           project_meta_langue_tbl.meta_value AS project_meta_langue,
           project_taxonomy_Pays_tbl.name AS project_taxonomy_Pays,
           project_taxonomy_support_tbl.name AS project_taxonomy_support,
           project_meta_edition_originale_tbl.meta_value AS project_meta_edition_originale,
           project_meta_revendication_explicite_du_genre_manifestaire_tbl.meta_value AS project_meta_revendication_explicite_du_genre_manifestaire,
           project_meta_correspondance_definition_du_genre_du_manifeste_tbl.meta_value AS project_meta_correspondance_definition_du_genre_du_manifeste,
           project_meta_critique_caracteristiques_manifestaires_tbl.meta_value AS project_meta_critique_caracteristiques_manifestaires,
           project_meta_ref_biblio_liens_tbl.meta_value AS project_meta_ref_biblio_liens,
           project_meta_autres_precisions_public_tbl.meta_value AS project_meta_autres_precisions_public,
           project_meta_autres_precisions_prive_tbl.meta_value AS project_meta_autres_precisions_prive,
           project_meta_identifiant_numerique_tbl.meta_value AS project_meta_identifiant_numerique
    FROM wp_664041_posts AS posts_project
      INNER JOIN wp_664041_users AS posts_project_author
         ON posts_project_author.ID = posts_project.post_author
      INNER JOIN (SELECT project_meta_signataires_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_signataires_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_signataires_tbl_posts   ON project_meta_signataires_tbl_postmeta.post_id = project_meta_signataires_tbl_posts.ID   AND project_meta_signataires_tbl_posts.post_type = 'project') AS project_meta_signataires_tbl
         ON project_meta_signataires_tbl.meta_key = 'signataires' AND project_meta_signataires_tbl.id = posts_project.ID 
      INNER JOIN (SELECT name, object_id as id FROM wp_664041_terms AS project_taxonomy_langue_originale_tbl_terms INNER JOIN wp_664041_term_taxonomy AS project_taxonomy_langue_originale_tbl_termtaxonomy ON project_taxonomy_langue_originale_tbl_termtaxonomy.term_id = project_taxonomy_langue_originale_tbl_terms.term_id  AND project_taxonomy_langue_originale_tbl_termtaxonomy.taxonomy = 'langue_originale' INNER JOIN wp_664041_term_relationships AS rel_project_taxonomy_langue_originale_tbl  ON project_taxonomy_langue_originale_tbl_termtaxonomy.term_taxonomy_id = rel_project_taxonomy_langue_originale_tbl.term_taxonomy_id) AS project_taxonomy_langue_originale_tbl
         ON project_taxonomy_langue_originale_tbl.ID = posts_project.id 
      INNER JOIN (SELECT project_meta_titre_du_manifeste_en_anglais_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_titre_du_manifeste_en_anglais_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_titre_du_manifeste_en_anglais_tbl_posts   ON project_meta_titre_du_manifeste_en_anglais_tbl_postmeta.post_id = project_meta_titre_du_manifeste_en_anglais_tbl_posts.ID   AND project_meta_titre_du_manifeste_en_anglais_tbl_posts.post_type = 'project') AS project_meta_titre_du_manifeste_en_anglais_tbl
         ON project_meta_titre_du_manifeste_en_anglais_tbl.meta_key = 'titre_du_manifeste_en_anglais' AND project_meta_titre_du_manifeste_en_anglais_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_premiere_publication_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_premiere_publication_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_premiere_publication_tbl_posts   ON project_meta_premiere_publication_tbl_postmeta.post_id = project_meta_premiere_publication_tbl_posts.ID   AND project_meta_premiere_publication_tbl_posts.post_type = 'project') AS project_meta_premiere_publication_tbl
         ON project_meta_premiere_publication_tbl.meta_key = 'premiere_publication' AND project_meta_premiere_publication_tbl.id = posts_project.ID 
      INNER JOIN (SELECT name, object_id as id FROM wp_664041_terms AS project_taxonomy_mouvements_en_langue_tbl_terms INNER JOIN wp_664041_term_taxonomy AS project_taxonomy_mouvements_en_langue_tbl_termtaxonomy ON project_taxonomy_mouvements_en_langue_tbl_termtaxonomy.term_id = project_taxonomy_mouvements_en_langue_tbl_terms.term_id  AND project_taxonomy_mouvements_en_langue_tbl_termtaxonomy.taxonomy = 'mouvements_en_langue' INNER JOIN wp_664041_term_relationships AS rel_project_taxonomy_mouvements_en_langue_tbl  ON project_taxonomy_mouvements_en_langue_tbl_termtaxonomy.term_taxonomy_id = rel_project_taxonomy_mouvements_en_langue_tbl.term_taxonomy_id) AS project_taxonomy_mouvements_en_langue_tbl
         ON project_taxonomy_mouvements_en_langue_tbl.ID = posts_project.id 
      INNER JOIN (SELECT name, object_id as id FROM wp_664041_terms AS project_taxonomy_mouvement_en_anglais_tbl_terms INNER JOIN wp_664041_term_taxonomy AS project_taxonomy_mouvement_en_anglais_tbl_termtaxonomy ON project_taxonomy_mouvement_en_anglais_tbl_termtaxonomy.term_id = project_taxonomy_mouvement_en_anglais_tbl_terms.term_id  AND project_taxonomy_mouvement_en_anglais_tbl_termtaxonomy.taxonomy = 'mouvement_en_anglais' INNER JOIN wp_664041_term_relationships AS rel_project_taxonomy_mouvement_en_anglais_tbl  ON project_taxonomy_mouvement_en_anglais_tbl_termtaxonomy.term_taxonomy_id = rel_project_taxonomy_mouvement_en_anglais_tbl.term_taxonomy_id) AS project_taxonomy_mouvement_en_anglais_tbl
         ON project_taxonomy_mouvement_en_anglais_tbl.ID = posts_project.id 
      INNER JOIN (SELECT project_meta_mouvement_langue_originale_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_mouvement_langue_originale_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_mouvement_langue_originale_tbl_posts   ON project_meta_mouvement_langue_originale_tbl_postmeta.post_id = project_meta_mouvement_langue_originale_tbl_posts.ID   AND project_meta_mouvement_langue_originale_tbl_posts.post_type = 'project') AS project_meta_mouvement_langue_originale_tbl
         ON project_meta_mouvement_langue_originale_tbl.meta_key = 'mouvement_langue_originale' AND project_meta_mouvement_langue_originale_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_mouvement_anglais_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_mouvement_anglais_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_mouvement_anglais_tbl_posts   ON project_meta_mouvement_anglais_tbl_postmeta.post_id = project_meta_mouvement_anglais_tbl_posts.ID   AND project_meta_mouvement_anglais_tbl_posts.post_type = 'project') AS project_meta_mouvement_anglais_tbl
         ON project_meta_mouvement_anglais_tbl.meta_key = 'mouvement_anglais' AND project_meta_mouvement_anglais_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_domaines_dappartenance_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_domaines_dappartenance_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_domaines_dappartenance_tbl_posts   ON project_meta_domaines_dappartenance_tbl_postmeta.post_id = project_meta_domaines_dappartenance_tbl_posts.ID   AND project_meta_domaines_dappartenance_tbl_posts.post_type = 'project') AS project_meta_domaines_dappartenance_tbl
         ON project_meta_domaines_dappartenance_tbl.meta_key = 'domaines_dappartenance' AND project_meta_domaines_dappartenance_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_langue_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_langue_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_langue_tbl_posts   ON project_meta_langue_tbl_postmeta.post_id = project_meta_langue_tbl_posts.ID   AND project_meta_langue_tbl_posts.post_type = 'project') AS project_meta_langue_tbl
         ON project_meta_langue_tbl.meta_key = 'langue' AND project_meta_langue_tbl.id = posts_project.ID 
      INNER JOIN (SELECT name, object_id as id FROM wp_664041_terms AS project_taxonomy_Pays_tbl_terms INNER JOIN wp_664041_term_taxonomy AS project_taxonomy_Pays_tbl_termtaxonomy ON project_taxonomy_Pays_tbl_termtaxonomy.term_id = project_taxonomy_Pays_tbl_terms.term_id  AND project_taxonomy_Pays_tbl_termtaxonomy.taxonomy = 'Pays' INNER JOIN wp_664041_term_relationships AS rel_project_taxonomy_Pays_tbl  ON project_taxonomy_Pays_tbl_termtaxonomy.term_taxonomy_id = rel_project_taxonomy_Pays_tbl.term_taxonomy_id) AS project_taxonomy_Pays_tbl
         ON project_taxonomy_Pays_tbl.ID = posts_project.id 
      INNER JOIN (SELECT name, object_id as id FROM wp_664041_terms AS project_taxonomy_support_tbl_terms INNER JOIN wp_664041_term_taxonomy AS project_taxonomy_support_tbl_termtaxonomy ON project_taxonomy_support_tbl_termtaxonomy.term_id = project_taxonomy_support_tbl_terms.term_id  AND project_taxonomy_support_tbl_termtaxonomy.taxonomy = 'support' INNER JOIN wp_664041_term_relationships AS rel_project_taxonomy_support_tbl  ON project_taxonomy_support_tbl_termtaxonomy.term_taxonomy_id = rel_project_taxonomy_support_tbl.term_taxonomy_id) AS project_taxonomy_support_tbl
         ON project_taxonomy_support_tbl.ID = posts_project.id 
      INNER JOIN (SELECT project_meta_edition_originale_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_edition_originale_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_edition_originale_tbl_posts   ON project_meta_edition_originale_tbl_postmeta.post_id = project_meta_edition_originale_tbl_posts.ID   AND project_meta_edition_originale_tbl_posts.post_type = 'project') AS project_meta_edition_originale_tbl
         ON project_meta_edition_originale_tbl.meta_key = 'edition_originale' AND project_meta_edition_originale_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_revendication_explicite_du_genre_manifestaire_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_revendication_explicite_du_genre_manifestaire_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_revendication_explicite_du_genre_manifestaire_tbl_posts   ON project_meta_revendication_explicite_du_genre_manifestaire_tbl_postmeta.post_id = project_meta_revendication_explicite_du_genre_manifestaire_tbl_posts.ID   AND project_meta_revendication_explicite_du_genre_manifestaire_tbl_posts.post_type = 'project') AS project_meta_revendication_explicite_du_genre_manifestaire_tbl
         ON project_meta_revendication_explicite_du_genre_manifestaire_tbl.meta_key = 'revendication_explicite_du_genre_manifestaire' AND project_meta_revendication_explicite_du_genre_manifestaire_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_correspondance_definition_du_genre_du_manifeste_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_correspondance_definition_du_genre_du_manifeste_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_correspondance_definition_du_genre_du_manifeste_tbl_posts   ON project_meta_correspondance_definition_du_genre_du_manifeste_tbl_postmeta.post_id = project_meta_correspondance_definition_du_genre_du_manifeste_tbl_posts.ID   AND project_meta_correspondance_definition_du_genre_du_manifeste_tbl_posts.post_type = 'project') AS project_meta_correspondance_definition_du_genre_du_manifeste_tbl
         ON project_meta_correspondance_definition_du_genre_du_manifeste_tbl.meta_key = 'correspondance_definition_du_genre_du_manifeste' AND project_meta_correspondance_definition_du_genre_du_manifeste_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_critique_caracteristiques_manifestaires_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_critique_caracteristiques_manifestaires_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_critique_caracteristiques_manifestaires_tbl_posts   ON project_meta_critique_caracteristiques_manifestaires_tbl_postmeta.post_id = project_meta_critique_caracteristiques_manifestaires_tbl_posts.ID   AND project_meta_critique_caracteristiques_manifestaires_tbl_posts.post_type = 'project') AS project_meta_critique_caracteristiques_manifestaires_tbl
         ON project_meta_critique_caracteristiques_manifestaires_tbl.meta_key = 'critique_caracteristiques_manifestaires' AND project_meta_critique_caracteristiques_manifestaires_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_ref_biblio_liens_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_ref_biblio_liens_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_ref_biblio_liens_tbl_posts   ON project_meta_ref_biblio_liens_tbl_postmeta.post_id = project_meta_ref_biblio_liens_tbl_posts.ID   AND project_meta_ref_biblio_liens_tbl_posts.post_type = 'project') AS project_meta_ref_biblio_liens_tbl
         ON project_meta_ref_biblio_liens_tbl.meta_key = 'ref_biblio_liens' AND project_meta_ref_biblio_liens_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_autres_precisions_public_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_autres_precisions_public_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_autres_precisions_public_tbl_posts   ON project_meta_autres_precisions_public_tbl_postmeta.post_id = project_meta_autres_precisions_public_tbl_posts.ID   AND project_meta_autres_precisions_public_tbl_posts.post_type = 'project') AS project_meta_autres_precisions_public_tbl
         ON project_meta_autres_precisions_public_tbl.meta_key = 'autres_precisions_public' AND project_meta_autres_precisions_public_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_autres_precisions_prive_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_autres_precisions_prive_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_autres_precisions_prive_tbl_posts   ON project_meta_autres_precisions_prive_tbl_postmeta.post_id = project_meta_autres_precisions_prive_tbl_posts.ID   AND project_meta_autres_precisions_prive_tbl_posts.post_type = 'project') AS project_meta_autres_precisions_prive_tbl
         ON project_meta_autres_precisions_prive_tbl.meta_key = 'autres_precisions_prive' AND project_meta_autres_precisions_prive_tbl.id = posts_project.ID 
      INNER JOIN (SELECT project_meta_identifiant_numerique_tbl_posts.ID as id, meta_value, meta_key  FROM wp_664041_postmeta AS project_meta_identifiant_numerique_tbl_postmeta  INNER JOIN wp_664041_posts AS project_meta_identifiant_numerique_tbl_posts   ON project_meta_identifiant_numerique_tbl_postmeta.post_id = project_meta_identifiant_numerique_tbl_posts.ID   AND project_meta_identifiant_numerique_tbl_posts.post_type = 'project') AS project_meta_identifiant_numerique_tbl
         ON project_meta_identifiant_numerique_tbl.meta_key = 'identifiant_numerique' AND project_meta_identifiant_numerique_tbl.id = posts_project.ID 
    WHERE 1=1 
       AND posts_project.post_type = 'project'
    


  • [deleted] replied

    Thank you. The query is most probably causing the issue here. The PHP SQL parser we use has issues with UNION, JOIN and CONCAT functions, and also if you include a sub-query. To resolve 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.



  • Mel replied

    Thank you for your time. 

    I am sorry but SQL is not my thing, so I am not really sure about what you are asking me. The query is automatically generated by the plugin. I thought it was an acf field issue but even if I try with the classical queries or to build a table on the basis of the classical "posts", the error appears. 

  • [deleted] replied

    Please provide me a temporary WP-admin (administrator) user 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 parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.

  •   Mel replied privately
  • [deleted] replied

    We are not able to replicate the issue creating manual or SQL tables which indicates that the query you are using is causing the issue.

    Please have a look at this step by step video tutorial on how to create a view for a MySQL query based table 





  • Mel replied

    Did you tried the option to "Create a MySQL-query-based data table by generating a query to the WordPress database (posts, taxonomies, postmeta) with a GUI tool."? 

    Because that's what I used to connect custom posts in WordPress with the table and the error occurs every time I use that option. 

  • [deleted] replied

    Hi Mel

    Unfortunately I am not sure what is the case here so I forwarded this to our development, they will be able to provide more information.

    I will update you as soon as I hear back from them.

    Thank you for your time and patience.


  • [deleted] replied

    Hi Mel

    Please note: this tool 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 you are not familiar with writing queries we would suggest using another method for creating your tables.
    Preparing MySQL queries for you is not included in the plugin support unfortunately.


  • Mel replied

    Hi Blaženka, 

    Ok, I understand that. But please note that I tried to use the option to generate a query to the WP database, and even with a very simple query (so, excluding any ACF or custom field, just calling for post_title and ID) the error I reported few days earlier still occurs. That option in particular seems to have some troubles and I suppose that it's important for your team to have returns. 

    Unless I misunderstood the use of that option and the plugin is not able to create or edit entries this way.

    Thanks again for you answers. 

  • [deleted] replied

    Hi Mel

    Thank you for the feedback, I have made a note to our developers so they are aware of this and so they can focus on the improvement.

    Do let us know if there is anything else we can do to assist you.