I have to bump this as I have the exact same error. Same file, same line, same problem.
I have a forum installed into the same database as wordpress. I would like that forum to handle the articles comments instead of a normal commenting system. All I need is a link to the thread that belongs to the article. The link should say something like “5 comments in forum”. Hence, I need the 5 to be pulled out of the Database.
Since I don’t really know the correct words I hope this explains what I need.