Quote:
Originally Posted by Zachery
Don't you need a join of some sort to get the post.postid from the POST TABLE
Not to mention a table prefix for it.
|
I have no idea really Zach
My Objective is merely to get an attachment url link to appear in rss feeds
Edit: Tested code, doesn't work.
PHP Code:
if ($_REQUEST['type'] == 'MEDIA')
{ // check for attachments
$attachments = $DB_site->query("
SELECT attachment.filename, attachment.filesize, attachment.attachmentid, attachment.postid
FROM " . TABLE_PREFIX . "attachment
LEFT JOIN " . TABLE_PREFIX . "post ON (post.postid = attachment.postid)
LEFT JOIN " . TABLE_PREFIX . "thread ON (post.postid = thread.firstpostid)
ORDER BY thread.dateline DESC
LIMIT 15
");
while ($attachment = $DB_site->fetch_array($attachments))
{
$post['attachments']["$attachment[attachmentid]"] = $attachment;
}
}