For future reference, you needed to put the multiple FROM tables between brackets () when you have JOINS.
PHP Code:
SELECT thread.threadid, thread.forumid,
IF(threadread.readtime IS NULL, 1147835566, IF(threadread.readtime < 1147835566, 1147835566, threadread.readtime)) AS threadread,
IF(forumread.readtime IS NULL, 1147835566, IF(forumread.readtime < 1147835566, 1147835566, forumread.readtime)) AS forumread,
thread.lastpost, subscribethread.subscribethreadid
FROM (sg_thread AS thread,
sg_subscribethread AS subscribethread)
LEFT JOIN sg_threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = 1)
LEFT JOIN sg_forumread AS forumread ON (forumread.forumid = thread.forumid AND forumread.userid = 1)
WHERE subscribethread.threadid = thread.threadid
AND subscribethread.userid = 1
AND thread.visible = 1
HAVING thread.lastpost > IF(threadread > forumread, threadread, forumread);
I had to figure this out on many of my non vb apps I have written when I upgraded. What a joy that was.