
04-09-2005, 10:39 AM
|
 |
|
|
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by ManagerJosh
I'm trying to list attachments in external.php so we can see what's files are available.
PHP Code:
if ($_REQUEST['type'] == 'RSS2') { // check for attachments $attachments = $DB_site->query(" SELECT attachment.filename, attachment.filesize, attachment.visible, attachment.attachmentid, attachment.counter, post.postid FROM " . TABLE_PREFIX . "attachment WHERE post.postid = $postid ORDER BY attachment.dateline "); while ($attachment = $DB_site->fetch_array($attachments)) { $post['attachments']["$attachment[attachmentid]"] = $attachment; } }
That code gives me a database error,
Invalid SQL: SELECT attachment.filename, attachment.filesize, attachment.visible, attachment.attachmentid, attachment.counter, post.postid FROM attachment WHERE post.postid = ORDER BY attachment.dateline mysql error: You have an error in your SQL syntax near 'ORDER BY attachment.dateline ' at line 5mysql error number: 1064
So yea, didn't work...ideas?
|
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.
|