MySQL error

Silverstripe Version: Silverstripe3

Question: MYSQL error. How to fix it?

Details of your query go here

# [User Error] Uncaught SS_DatabaseException: Couldn't run query: SELECT DISTINCT count(DISTINCT "DataObjectAsPage"."ID") AS "Count" FROM "DataObjectAsPage" LEFT JOIN "Prize" ON "Prize"."ID" = "DataObjectAsPage"."ID" INNER JOIN "Prize_Levels" ON "Prize_Levels"."PrizeID" = "DataObjectAsPage"."ID" LEFT JOIN "MemberLevel" ON "Prize_Levels"."MemberLevelID" = "MemberLevel"."ID" INNER JOIN "Prize_PrizeCategories" ON "Prize_PrizeCategories"."PrizeID" = "DataObjectAsPage"."ID" LEFT JOIN "PrizeCategory" ON "Prize_PrizeCategories"."PrizeCategoryID" = "PrizeCategory"."ID" WHERE ("ParentID" = ?) AND ("Prize"."PrizeStatus" IN (?, ?)) AND ("MemberLevel"."Level" = ?) AND ("PrizeCategories"."PrizeCategoryID" = ?) AND ("DataObjectAsPage"."ClassName" IN (?)) Unknown column 'PrizeCategories.PrizeCategoryID' in 'where clause'


I’m afraid it’s pretty impossible to know how to fix it without knowing what code was being used to generate the query. Can you post some more detail in your question.

I think the table name is wrong here… AND (“PrizeCategories”.“PrizeCategoryID” = ?)
Is it Prize_PrizeCategories ?