ZomgStuff
06-11-2008, 01:51 AM
So currently this is my query.
$rating_load = $db->query_read("
SELECT p.postid, p.threadid, p.title, p.pagetext, r.*
FROM " . TABLE_PREFIX . "erate AS r
LEFT JOIN ".TABLE_PREFIX."post AS p ON(p.postid = r.pid)
WHERE r.rating = '".$rate_id."' AND r.uid = '".$user_id."' AND p.userid = '".$thisUser."'
ORDER BY p.postid DESC
");
Only problem is that I actually need thread.title as opposed to post.title, but I would sitll like to keep post.pagetext.
Now how do I do a double LEFT JOIN to link all there of these into a single array, I need to be able to use the following variables to output them into HTML.
thread.title, thread.threadid
post.pagetext, post.postid
I've made a little graphic representation of the 3 tables that I have. https://vborg.vbsupport.ru/external/2008/06/46.jpg
Thank you in advance.
Edit: This has been resolved, thanks!
$rating_load = $db->query_read("
SELECT p.postid, p.threadid, p.title, p.pagetext, r.*
FROM " . TABLE_PREFIX . "erate AS r
LEFT JOIN ".TABLE_PREFIX."post AS p ON(p.postid = r.pid)
WHERE r.rating = '".$rate_id."' AND r.uid = '".$user_id."' AND p.userid = '".$thisUser."'
ORDER BY p.postid DESC
");
Only problem is that I actually need thread.title as opposed to post.title, but I would sitll like to keep post.pagetext.
Now how do I do a double LEFT JOIN to link all there of these into a single array, I need to be able to use the following variables to output them into HTML.
thread.title, thread.threadid
post.pagetext, post.postid
I've made a little graphic representation of the 3 tables that I have. https://vborg.vbsupport.ru/external/2008/06/46.jpg
Thank you in advance.
Edit: This has been resolved, thanks!