Jump to content

Recommended Posts

I keep getting this error for my query...:

 

 

Reference 'Points' not supported (reference to group function)

 

 

 

What does it mean ? My query is below:

 

<?php
$SELECT = mysql_querY("SELECT Sum(listratings.RateNumber+15) AS Points,Count(listings.GameName+15) AS TotalRows,listings.Caption,listings.VotesIn,listings.GameName,listings.Banner,listings.BannerDays,listings.GameID,listings.ShortDescription,listings.UpdatedOn
		FROM listings 
		INNER JOIN listratings ON
		listings.GameID=listratings.GameID
		WHERE listings.Authorised='1'
		ORDER BY (Points/TotalRows) ASC")
		Or die(mysql_error());

?>

 

Ive never seen this mysql error before, what is the reason for it and how do i fix it ?

Link to comment
https://forums.phpfreaks.com/topic/162796-solved-mysql-error/
Share on other sites

I've never seen it before either.  But I see that you have aggregate functions (SUM and COUNT) in the SELECT statement, along with non-aggregated columns.  I think you need a GROUP BY to make the select work.

 

I'm not sure if the ORDER BY will be a problem once you add the GROUP BY or not.  I think it will be OK.  If not, you may have to add a column to the select to match the ORDER BY.

 

Try just adding the GROUP BY and let us know if that solves it.

Link to comment
https://forums.phpfreaks.com/topic/162796-solved-mysql-error/#findComment-859093
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.