This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

sql to get star rating for specific entry
#11

Hi Steven,
I have now.
The restaurant page with the comment on :
http://www.restaurantsintheminervois.co....garole.php
it has a four star rating comment on
on the database (when I go to edit comment it has listed "4 - Good")
On the village page
http://www.restaurantsintheminervois.co..../aigne.php
it has the query on the page name is as it is on DB.
But only default "waiting for a star rating" is displayed.
Thanks for you help
Peter

Reply
#12

Hi,

You have to use the numeric version of the page_id. You can find it in the ID column in Manage -> Pages. In your case the value is 4. So your SQL query should be:

$query = mysql_query("SELECT MAX(rating) AS highest_rating FROM comments WHERE is_approved = '1' AND page_id = '4'");

Have you completed the interview?
Reply
#13

Hi Steven,
It all works as it should, great!
Thanks for your help I really needed it.
Peter

Reply
#14

Hi,
what would be the sql reference for the "custom id" column

thanks for your help
Peter
Reply
#15

Hi
OK I see this column is not in the comments table so it cannot be referenced in my query.
thanks
Peter

Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Seven Thunders
21-Aug-2018, 04:05 AM
Last Post by cecilia
15-Jun-2014, 01:08 AM
Last Post by DuO-VB
21-Mar-2014, 04:26 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)