you need to format your code better when asking questions, it's easier to read
PHP Code:
$article = $DB_site->query_first("
SELECT article.*, articlepost.*, articlecategory.options AS categoryoptions FROM " . TABLE_PREFIX . "article AS article
INNER JOIN " . TABLE_PREFIX . "articlepost AS articlepost ON(articlepost.postid = article.firstpostid)
INNER JOIN " . TABLE_PREFIX . "articlecategory AS articlecategory ON(articlecategory.categoryid = article.categoryid)
WHERE article.articleid = $a AND articlepost.type=1");
i'm check it now