|
From: Jon O. <jon...@us...> - 2007-05-16 19:38:10
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes
In directory sc8-pr-cvs16:/tmp/cvs-serv12400/includes
Modified Files:
functions.php
Log Message:
Wrong LEFT JOIN syntax
Index: functions.php
===================================================================
RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** functions.php 28 Apr 2007 19:58:25 -0000 1.16
--- functions.php 16 May 2007 19:38:06 -0000 1.17
***************
*** 582,597 ****
default:
- /* Bug 50
- $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username
- FROM " . LINKS_TABLE . " AS f, " . LINK_CATEGORIES_TABLE . " AS cat
- LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link
- LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
- WHERE cat.cat_id = f.link_catid
- AND f.link_id = '" . $item_id . "'
- GROUP BY f.link_id ";
- */
$sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username
FROM " . LINKS_TABLE . " AS f
! LEFT JOIN " . LINK_CATEGORIES_TABLE . " AS cat ON cat.cat_id = f.link_catid
LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link
LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
--- 582,588 ----
default:
$sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username
FROM " . LINKS_TABLE . " AS f
! LEFT JOIN " . LINK_CATEGORIES_TABLE . " AS cat ON f.link_catid = cat.cat_id
LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link
LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
|