Hi Dave,
That is amazing. I'm genuinely overwhelmed at your kindness. Thank you.
--------------- Added [DATE]1475677791[/DATE] at [TIME]1475677791[/TIME] ---------------
I added a little, I'm just putting it all together here in case it's useful to anyone else.
Code:
These all work perfectly - DO NOT EDIT
UPDATE thread SET firstpostid = (SELECT postid FROM post WHERE threadid = thread.threadid ORDER BY postid ASC LIMIT 0,1)
UPDATE thread SET lastpostid = (SELECT postid FROM post WHERE threadid = thread.threadid ORDER BY postid DESC LIMIT 0,1)
UPDATE thread SET lastpost = (SELECT dateline FROM post WHERE threadid = thread.threadid ORDER BY postid DESC LIMIT 0,1)
UPDATE thread SET lastposterid = (SELECT userid FROM post WHERE threadid = thread.threadid ORDER BY postid DESC LIMIT 0,1)
UPDATE thread SET lastposter = (SELECT postusername FROM post WHERE threadid = thread.threadid ORDER BY postid DESC LIMIT 0,1)
UPDATE thread SET replycount = ((SELECT COUNT(threadid) AS count FROM post WHERE threadid = thread.threadid ORDER BY postid ASC LIMIT 0,1) - 1 )
UPDATE forum SET lastpost = (SELECT b.dateline FROM thread AS a INNER JOIN post AS b ON a.threadid = b.threadid WHERE a.forumid = forum.forumid ORDER BY b.postid DESC LIMIT 0,1)
UPDATE forum SET lastpostid = (SELECT b.postid FROM thread AS a INNER JOIN post AS b ON a.threadid = b.threadid WHERE a.forumid = forum.forumid ORDER BY b.postid DESC LIMIT 0,1)
UPDATE forum SET lastpostid = (SELECT b.postid FROM thread AS a INNER JOIN post AS b ON a.threadid = b.threadid WHERE a.forumid = forum.forumid ORDER BY b.postid DESC LIMIT 0,1)
UPDATE forum SET lastpostid = (SELECT b.postid FROM thread AS a INNER JOIN post AS b ON a.threadid = b.threadid WHERE a.forumid = forum.forumid ORDER BY b.postid DESC LIMIT 0,1)
I just need to find out how to reset the number of replies and I'm pretty much there.
I think the lack of number of replies is what is causing the "display number of posts per page" to fall over. Zero replies means no need to calculate pages.