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. Link to comment https://forums.phpfreaks.com/topic/29238-stumped-invalid-use-of-group-function-mysql/ 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. Link to comment https://forums.phpfreaks.com/topic/29238-stumped-invalid-use-of-group-function-mysql/#findComment-134069 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 Link to comment https://forums.phpfreaks.com/topic/29238-stumped-invalid-use-of-group-function-mysql/#findComment-134072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.