select p.name as articletype, t.name as authorname, a.*, b.body, date_format(a.lastupdated,'%r, %b %d, %Y') as articletime , p.template from articlebodies b right join (articles a join authors t join articletypes p on (a.id= and a.authorid=t.id and a.type=p.type)) on (b.articleid = a.id and a.id=) where 1