New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SQL Query #220

HayS33d opened this Issue Jun 8, 2017 · 1 comment


None yet
2 participants

HayS33d commented Jun 8, 2017

I have altered my prefix to my initialsWp,
I get an error when I open the wp-admin page at the top.
I put the provided SQL query into SQL Studio and get the same error however...

If I change 'AS post_date' to 'AS post_date1' the Order by to post_date1 and remove the CadWp_postmeta in Sql studio it returns data. I do not know where to fix this in the PHP code.

WordPress database error: [[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid column name 'CadWp_postmeta'. Code - 207]
SELECT DISTINCT CadWp_posts.*, CASE WHEN CadWp_posts.post_type = 'tribe_events' THEN CadWp_postmeta.meta_value ELSE CadWp_posts.post_date END AS post_date , CadWp_posts.post_date FROM CadWp_posts LEFT JOIN CadWp_postmeta as CadWp_postmeta on CadWp_posts.ID = CadWp_postmeta.post_id AND CadWp_postmeta.meta_key = '_EventStartDate' WHERE 1=1 AND CadWp_posts.post_name = 'events' AND CadWp_posts.post_type IN ('post', 'page', 'attachment', 'mailmunch_page', 'tribe_events', 'tribe-ea-record') AND ((CadWp_posts.post_status = 'publish' OR CadWp_posts.post_status = 'inherit' OR CadWp_posts.post_status = 'private')) ORDER BY post_date, CadWp_postmeta DESC


This comment has been minimized.

Show comment
Hide comment

patrickebates Apr 6, 2018


This should be corrected by a3575b0


patrickebates commented Apr 6, 2018

This should be corrected by a3575b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment