Incorrect usage of SUBQUERY and feature is disabled

115 words

I just looked at my home page to find it reporting a database error.  “Incorrect usage of SUBQUERY and feature is disabled by allow_view_trigger_sp_subquery in /etc/my.cnf”.

The select query in question looked like this:

SELECT p.*,

(SELECT COUNT(*) FROM `$t1` WHERE ParentID=p.ID) AS `NumComments`,

(SELECT MAX(PublishedDate) FROM `$t1` WHERE ParentID=p.ID) AS `NewestCommentDate`

FROM `$t1` p

Looks like my web host disabled sub-queries for some inexplicable reason and naturally I don’t have the ability to turn it back on.  So it’s back to the drawing board.  Posts won’t show the number of comments until I resolve this (I know, it’ll be a big hardship).

(P.S. Red, I’ll be pulling out Eclipse again to fix this. :)

Originally posted on my personal blog which was active from 2003 to 2020.

Sorry, new comments are disabled on older posts. This helps reduce spam. Active commenting almost always occurs within a day or two of new posts.