MyBB Community Forums
Common SQL Queries post Merge - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: Merge System Support (https://community.mybb.com/forum-180.html)
+--- Thread: Common SQL Queries post Merge (/thread-159622.html)



Common SQL Queries post Merge - Dylan M. - 2010-12-14

I'll keep this updated as often as new Queries are needed.
Please remember to change "mybb_" in these queries to whatever your prefix actually is.

All PMs are "Unread"
UPDATE `mybb_privatemessages` SET `readtime` = '1' WHERE `readtime` = 0 AND `folder` != 2;
UPDATE `mybb_privatemessages` SET `status` = '1' WHERE `status` = 0 AND `folder` != 2;

Replies Count is Off and/or Threads with 1 post are showing 1 reply instead of 0
UPDATE `mybb_threads` t SET firstpost=(SELECT MIN(pid) FROM `mybb_posts` p WHERE t.tid=p.tid) 

All Postcounts 0
UPDATE `mybb_forums` SET `usepostcounts` = '1';

PHP Error When Viewing Profiles
UPDATE `mybb_users` SET `birthday` = '' WHERE `birthday` LIKE '-%';

Members falsely show as visited post merge
UPDATE mybb_users SET lastvisit = UNIX_TIMESTAMP(NOW()) where lastvisit = '';
UPDATE mybb_users SET lastactive = UNIX_TIMESTAMP(NOW()) where lastactive = '';

Average statistics wrong
UPDATE mybb_users SET regdate = UNIX_TIMESTAMP(NOW()) where regdate = 0;

Cannot Send Mass Mail to all users post merge
UPDATE `mybb_users` SET `allownotices` = '1';