Page 1 of 1

SOLVED: MySQL5 error on ratings.php page

PostPosted: Sat Jun 10, 2006 1:14 am
Author: SLY LS1
Im just getting a general error on my ratings.php page, im 99% sure its got something to do with my MySQL5 upgrade, but im not sure where to put the () in the file.

The error is

General Error

Couldn't obtain post rating information

DEBUG MODE

SQL Error : 1054 Unknown column 'r.user_id' in 'on clause'

SELECT t.topic_title, t.rating_rank_id AS topic_rating, p.rating_rank_id AS post_rating, t.topic_id, u.username, u.user_id, r.rating_time, ro.label, ro.points AS label2, f.forum_id, p.post_id, u2.username as ratedby, u2.rating_status, u2.user_id as ratedby_id FROM phpbb_rating r, phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_forums f, phpbb_users u2, phpbb_rating_option ro, phpbb_rating_rank rt LEFT JOIN phpbb_rating_bias i ON i.user_id = 2 AND r.user_id = i.target_user WHERE r.post_id = p.post_id AND p.poster_id = u.user_id AND r.user_id = u2.user_id AND p.topic_id = t.topic_id AND t.topic_status = 0 AND t.forum_id = f.forum_id AND f.auth_view <= 1 AND f.auth_read <= 1 AND r.option_id = ro.option_id AND p.rating_rank_id = rt.rating_rank_id AND (i.bias_status IS NULL OR i.bias_status != 1) ORDER BY r.rating_time DESC LIMIT 20

Line : 301
File : /var/virtual/web/w1487/html/portal/integramod/ratings.php

Re: Small MySQL5 Error On ratings.php page

PostPosted: Sun Jun 11, 2006 9:06 pm
Author: SLY LS1
anyone ?

Re: Small MySQL5 Error On ratings.php page

PostPosted: Sun Jun 11, 2006 10:17 pm
Author: Teelk
You're right about it being a MySQL5 error. I had a fix for this before my computer exploded... I'm taking a look at it again, but I can't seem to get the ratings to turn on so I can replicate the problem... I'll keep ya posted.

Re: Small MySQL5 Error On ratings.php page

PostPosted: Sun Jun 11, 2006 11:06 pm
Author: Teelk
Ok, I got it...

Open ratings.php
FIND
Code: Select all
$sql_from = RATING_TABLE.' r, '. TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u2, ' . RATING_OPTION_TABLE . ' ro, ' . RATING_RANK_TABLE . ' rt';  
REPLACE WITH
Code: Select all
$sql_from = '('.RATING_TABLE.' r, '. TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u2, ' . RATING_OPTION_TABLE . ' ro, ' . RATING_RANK_TABLE . ' rt)';

Re: Small MySQL5 Error On ratings.php page

PostPosted: Sun Jun 11, 2006 11:34 pm
Author: SLY LS1
"Teelk";p="9246" wrote:Ok, I got it...



Teelk, you never cease to amaze me, you have done it again,

thanks a lot buddy

Cheers

SLY

Re: SOLVED: MySQL5 error on ratings.php page

PostPosted: Sun Jun 11, 2006 11:45 pm
Author: Teelk
No problemo... <img>

Re: SOLVED: MySQL5 error on ratings.php page

PostPosted: Sun Jun 11, 2006 11:53 pm
Author: SLY LS1
Maybe you could merge all these threads or create a new one with all the MySQL5 fixes and delete these below

http://integramod.com/forum/viewtopic.p ... ight=#9012

http://integramod.com/forum/viewtopic.p ... ight=#7076