I\'m using an old php script and have an error with this query. Since I\'m not experienced with mysql, I couldn\'t fix it.
\"SELECT COUNT(p.postid) AS pid, p.*,
Like the error says, you can't SELECT an aggregate function, such as COUNT, without grouping rows either explicitly (using GROUP BY) or implicitly (by just selecting the aggregate). To put it in less technical terms - you're telling the database, "Look up all posts by this username, and the threads they belong to, and the number of posts", and the database is answering you, "the number of posts in what?".
So you'll need to be more specific. If what you actually want is:
p.*
from the SELECT, and add GROUP BY t.threadid
to the end of the query.post
again to get the total post count.