desithugg Posted December 9, 2006 Share Posted December 9, 2006 [code]<?$start = $_GET['start'];$result = mysql_query("SELECT count(id) FROM s_users");if (!$result) { echo 'Could not run query: ' . mysql_error(); exit;}$total = $row[0];$totall = ($total-15);if($total < $start){$start = $totall;}if($start < "0"){$start = "0";}?><table border ='0' class='top' width='100%'><tr><td class='top'>Rank</a><td class='top'>Username/ID</td><td class='top'>Threads</td><td class='top'>Option</a></tr><?php$query = "SELECT s_users.user,s_users.id,count(threads.id) as posts FROM s_users left join threads on threads.poster = s_users.user order by count(threads.id) DESC limit $start,15";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)) {$threads = number_format($row['posts']);echo "<tr><td class='top'>$count</td><td class='top'>". $row['user'] ."/". $row['id'] ."</td><td class='top'>$threads</td><td class='top'><a href='index.php?action=view&user=". $row['user'] ."'>View Profile</a><br><a href='forums.php?action=sendpm&senf=". $row['user'] ."'>Send Pm</a><br><a href='tbattle.php?p_id=". $row['user'] ."'>Battle</a></td></tr>";}?></table><table align='center'><tr><th class='rankthing'><?$next = ($start+15);$last = ($start-15);?>[/code]I keep getting the error [red]Invalid use of group function[/red]before I had [red]group by s_users.user[/red] and I got that erro but than I removed it but I continue to receive the error Link to comment https://forums.phpfreaks.com/topic/29996-invalid-use-of-group-function/ Share on other sites More sharing options...
linuxdream Posted December 9, 2006 Share Posted December 9, 2006 Try changing the "order by count()" to what you named the initial count in the columns area......ORDER BY posts... Link to comment https://forums.phpfreaks.com/topic/29996-invalid-use-of-group-function/#findComment-137980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.