I have already changed the file in the post above and it's better to do it this way:
PHP Code:
SELECT affiliate_id,sitename,siteurl,buttonurl,name,id,sitedesc,clicksout,clicksin,tota lrating,totalvotes
FROM vB_affiliates AS affiliates LEFT JOIN vB_affiliates_types AS affiliates_type
ON affiliates.type = affiliates_types.id
WHERE active='1' AND approved='1'
ORDER BY sitename DESC
LIMIT 0,20;