|
From: Jon O. <jon...@us...> - 2007-05-16 19:41:26
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes
In directory sc8-pr-cvs16:/tmp/cvs-serv14409/includes
Modified Files:
functions.php
Log Message:
Wrong LEFT JOIN syntax
Index: functions.php
===================================================================
RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** functions.php 4 May 2007 19:02:04 -0000 1.34
--- functions.php 16 May 2007 19:41:22 -0000 1.35
***************
*** 989,1004 ****
default:
- /* Bug 50
- $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username
- FROM " . PA_FILES_TABLE . " AS f, " . PA_CATEGORY_TABLE . " AS cat
- LEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file
- LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
- WHERE cat.cat_id = f.file_catid
- AND f.file_id = '" . $item_id . "'
- GROUP BY f.file_id ";
- */
$sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username
FROM " . PA_FILES_TABLE . " AS f
! LEFT JOIN " . PA_CATEGORY_TABLE . " AS cat ON cat.cat_id = f.file_catid
LEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file
LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
--- 989,995 ----
default:
$sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username
FROM " . PA_FILES_TABLE . " AS f
! LEFT JOIN " . PA_CATEGORY_TABLE . " AS cat ON f.file_catid = cat.cat_id
LEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file
LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
|