It is solved now, thanks for your help Chris and Rudy.
Following was the error I got:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN
post_author ORDER BY
Thanks for the tip, I will definitely test my queries when I get such errors the next time. I now have the following and it works perfectly.
$query = mysql_query("SELECT
LEFT JOIN `authors` ON `author_id` = `post_author`
WHERE `post_type` = 'post'
ORDER BY `post_id` DESC LIMIT 0,8");
I guess that my first query worked on the localhost and not on the server because they have different MySQL versions.