As previously announced via banners and our newsletters, support is no longer available through this platform.

For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.

You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.

Paid customers: Please log in to your store account for support.

Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com

Okay
  Public Ticket #2452053
SQL ERROR
Closed

Comments

  • Craig Elkins started the conversation

    WITHOUT conditionals, my query runs fine (see attached).  As soon as I add the conditional: "post.taxonomy.category" = "Some Category" (or Like or %Like%) I get a column not found error.  This is the error:

    No results found. Please check if this query is correct! Table Constructor needs a query that returns data to build a wpDataTable. Error: Unknown column 'post_taxonomy_category' in 'on clause

    Here is the SQL:

    SELECT post_taxonomy_category_tbl.name AS post_taxonomy_category,        post_meta_date_published_tbl.meta_value AS post_meta_date_published,        post_meta_author_tbl.meta_value AS post_meta_author,        posts_post.post_title AS post_post_title,        posts_post.post_content AS post_post_content FROM wp2k_posts AS posts_post   INNER JOIN (SELECT name, object_id as id FROM wp2k_terms AS post_taxonomy_category_tbl_terms INNER JOIN wp2k_term_taxonomy AS post_taxonomy_category_tbl_termtaxonomy ON post_taxonomy_category_tbl_termtaxonomy.term_id = post_taxonomy_category_tbl_terms.term_id  AND post_taxonomy_category_tbl_termtaxonomy.taxonomy = 'category' INNER JOIN wp2k_term_relationships AS rel_post_taxonomy_category_tbl  ON post_taxonomy_category_tbl_termtaxonomy.term_taxonomy_id = rel_post_taxonomy_category_tbl.term_taxonomy_id) AS post_taxonomy_category_tbl      ON post_taxonomy_category_tbl.ID = posts_post.id      AND post_taxonomy_category = 'Published & Accepted Papers'   INNER JOIN (SELECT post_meta_date_published_tbl_posts.ID as id, meta_value, meta_key  FROM wp2k_postmeta AS post_meta_date_published_tbl_postmeta  INNER JOIN wp2k_posts AS post_meta_date_published_tbl_posts   ON post_meta_date_published_tbl_postmeta.post_id = post_meta_date_published_tbl_posts.ID   AND post_meta_date_published_tbl_posts.post_type = 'post') AS post_meta_date_published_tbl      ON post_meta_date_published_tbl.meta_key = 'date_published' AND post_meta_date_published_tbl.id = posts_post.ID   INNER JOIN (SELECT post_meta_author_tbl_posts.ID as id, meta_value, meta_key  FROM wp2k_postmeta AS post_meta_author_tbl_postmeta  INNER JOIN wp2k_posts AS post_meta_author_tbl_posts   ON post_meta_author_tbl_postmeta.post_id = post_meta_author_tbl_posts.ID   AND post_meta_author_tbl_posts.post_type = 'post') AS post_meta_author_tbl      ON post_meta_author_tbl.meta_key = 'author' AND post_meta_author_tbl.id = posts_post.ID WHERE 1=1    AND posts_post.post_type = 'post'

  • Craig Elkins replied

    Problem solved: You can't use column aliases in the on clause. You'll have to use the real name instead - post_taxonomy_category_tbl.name. Here's a link to the stackoverflow question using my query: https://stackoverflow.com/questions/62564091/sql-error-in-mysql-query-error-unknown-column-post-taxonomy-category-in-on

  •  2,576
    Aleksandar replied

    Hey Craig

    Great news, thanks for letting everyone know.

    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