fixed version
PHP Code:
$article = $DB_site->query_first("
SELECT article.*, articlepost.*, articlecategory.options AS categoryoptions
FROM article AS article
INNER JOIN articlepost AS articlepost ON(articlepost.postid = article.firstpostid)
INNER JOIN articlecategory AS articlecategory ON(articlecategory.categoryid = article.categoryid)
WHERE article.articleid = $a AND articlepost.type=1");