{"id":1527654,"date":"2018-05-10T12:14:19","date_gmt":"2018-05-10T19:14:19","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/"},"modified":"2018-05-10T12:14:19","modified_gmt":"2018-05-10T19:14:19","slug":"php-query-error","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/","title":{"rendered":"PHP query error"},"content":{"rendered":"<p>Greetings,<br \/>\nI inherited an already built website, when I got highered.  I do not know if we are using the free version of this, or a paid version.  Anyways, I wanted to bring to your attention an error that I am getting in my logs.<br \/>\n<code>WordPress database error Unknown column 'wp_postmeta.meta_value' in 'field list' for query SELECT  DISTINCT wp_posts.*, MIN(wp_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM wp_posts  LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' )  WHERE 1=1  AND wp_posts.post_type = 'tribe_events' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'order_received' OR wp_posts.post_status = 'order_paid' OR wp_posts.post_status = 'order_cancelled' OR wp_posts.post_status = 'order_fraud' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'tribe-ea-success' OR wp_posts.post_status = 'tribe-ea-failed' OR wp_posts.post_status = 'tribe-ea-schedule' OR wp_posts.post_status = 'tribe-ea-pending' OR wp_posts.post_status = 'tribe-ea-draft')  ORDER BY EventStartDate DESC, wp_posts.post_date DESC LIMIT 0, 1 made by require('wp-blog-header.php'), wp, WP-&gt;main, WP-&gt;query_posts, WP_Query-&gt;query, WP_Query-&gt;get_posts<\/code><br \/>\nIt appears that line 535 of the &#8220;wp-content\/plugins\/the-events-calendar\/src\/Tribe\/Query.php&#8221; file sets the table for the &#8220;EventStartDate&#8221; to the wp_postmeta table, but the query itself renames that table to &#8220;tribe_event_end_date&#8221; with the &#8220;LEFT JOIN wp_postmeta as tribe_event_end_date&#8221; part of it.  I had updated the plugin this morning in hopes that it would be resolved, but it appears that it is still incorrect.  I can&#8217;t tell exactly where this query is being run, but it shows up in my error log frequently enough.  The plugin seems to run just fine otherwise. <\/p>\n","protected":false},"template":"","class_list":["post-1527654","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP query error -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP query error -\" \/>\n<meta property=\"og:description\" content=\"Greetings, I inherited an already built website, when I got highered. I do not know if we are using the free version of this, or a paid version. Anyways, I wanted to bring to your attention an error that I am getting in my logs. WordPress database error Unknown column &#039;wp_postmeta.meta_value&#039; in &#039;field list&#039; for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/\",\"name\":\"PHP query error -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-05-10T19:14:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Welcome!\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pre-Sales Questions\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"PHP query error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP query error -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/","og_locale":"en_US","og_type":"article","og_title":"PHP query error -","og_description":"Greetings, I inherited an already built website, when I got highered. I do not know if we are using the free version of this, or a paid version. Anyways, I wanted to bring to your attention an error that I am getting in my logs. WordPress database error Unknown column 'wp_postmeta.meta_value' in 'field list' for [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/","name":"PHP query error -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-05-10T19:14:19+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-query-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Welcome!","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/"},{"@type":"ListItem","position":4,"name":"Pre-Sales Questions","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/_welcome\/pre-sales-questions\/"},{"@type":"ListItem","position":5,"name":"PHP query error"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1527654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1527654\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1527654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}