pureDesi Posted December 2, 2006 Share Posted December 2, 2006 I have this query being passed to MySQL:[code]UPDATE forums, threadsSET forums.lastThreadID=MAX(threads.threadID)-1, forums.lastMemberID='5', forums.numPosts = forums.numPosts+1, threads.replies = threads.replies+1WHERE forums.forumID = threads.forumID AND threads.threadID = '3'";[/code]And I keep getting [code]#1111 - Invalid use of group function [/code]I have no clue why and I've tried a couple of different things, but to no avail. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
artacus Posted December 2, 2006 Share Posted December 2, 2006 Easy, you can't use MAX() because you haven't grouped anything to have a max, min, avg etc.You probably need to use a subquery here. Quote Link to comment Share on other sites More sharing options...
pureDesi Posted December 2, 2006 Author Share Posted December 2, 2006 Ahh.. thank you, I've been looking at this page for about an hour refreshing it every 2 minutes until I saw your reply, Thanks :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.