com web/master: Adjusted search to use a LEFT JOIN.: manage/user-notes.php
| From: | Sherif Ramadan | Date: | Sat, 15 Dec 2012 13:19:46 +0000 |
| Subject: | com web/master: Adjusted search to use a LEFT JOIN.: manage/user-notes.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15096@lists.php.net to get a copy of this message | ||
Commit: 63290154e7df51c6e8a3b5969c6ebaf020fc4e0d
Author: Sherif Ramadan <googleguy@php.net> Sat, 15 Dec 2012 08:19:46 -0500
Parents: 86774530b69041712ab1310220e0c8938c95cf78
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=63290154e7df51c6e8a3b5969c6ebaf020fc4e0d
Log:
Adjusted search to use a LEFT JOIN.
Changed paths:
M manage/user-notes.php
Diff:
diff --git a/manage/user-notes.php b/manage/user-notes.php
index d89ef38..8315ea8 100644
--- a/manage/user-notes.php
+++ b/manage/user-notes.php
@@ -75,7 +75,7 @@ if (!$action) {
if(isset($_REQUEST['keyword'])) {
$sql = 'SELECT SUM(votes.vote) AS up, (COUNT(votes.vote) - SUM(votes..vote)) AS down,
note.*, UNIX_TIMESTAMP(note.ts) AS ts '.
'FROM note '.
- 'JOIN(votes) ON (note.id = votes.note_id) '.
+ 'LEFT JOIN(votes) ON (note.id = votes.note_id) '.
'WHERE ';
if (is_numeric($_REQUEST['keyword'])) {
$sql .= 'note.id = ' . (int) $_REQUEST['keyword'];