Jump to content

Problem with short sql query


bwaxse

Recommended Posts

Hello all,

I get "Invalid use of group function" with this query and don't know why.

I'm trying to look through a database of entries to find the user with the most entries and get the name and the number.  Thanks!

[code]$sql = "SELECT sUsername, COUNT(sUsername) FROM tbl_questions WHERE sSchoolID = ".$_SESSION['schoolid']." ORDER BY COUNT(*) DESC LIMIT 0,1";[/code]
Link to comment
https://forums.phpfreaks.com/topic/21937-problem-with-short-sql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.