Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 10 Years, 8 Months ago Please help me to fix this query?
#1
Solved: 10 Years, 8 Months ago
I have a problem with this one. It fetches user last threads but the problem is when I move user thread is shows second duplicated thread that has no views neither replies:

$query = $db->query("
		SELECT t.*, t.subject AS threadsubject, u.username, u.displaygroup, p.displaystyle AS threadprefix,
		t.dateline AS threaddate, t.lastpost AS threadlastpost
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
		LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposter=u.username)
		WHERE t.visible = '1' And t.uid = '{$memprofile['uid']}'
		GROUP BY t.tid
		ORDER BY threadlastpost DESC
		LIMIT 0, {$threadlimit}
	");
#2
Solved: 10 Years, 8 Months ago
Change:
WHERE t.visible = '1' And t.uid = '{$memprofile['uid']}'
to:
WHERE t.visible = '1' AND t.uid = '{$memprofile['uid']}' AND t.closed NOT LIKE 'moved|%'
#3
Solved: 10 Years, 8 Months ago
Wow is there something you don't know LOL. Thanks very much.
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)