MyBB Community Forums

Full Version: [Tutorial] Common SQL queries and how to run them
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
I have an installation of MyBB that has actually been online for a long time, but since I've been working on the site and getting ready to launch it, it has been totally hidden from the public. I'm getting ready to launch it very soon and I was wondering if there was some way I could reset the stats on the board with an SQL Query so that when I do finally open the site, it looks brand new. Any help or suggestions would be appreciated!
how can i run query for only members of a particular group? like i want to set a default value of my custom profile field to all the already registered users of a particular group?.
Can anyone help me making a query?
I have recently installed newpoints on my forum and I want to count current posts and threads as points so I would need a query that looked at a user's postnumber x 2 + threadnumber x 3 and then set the result as their newpoint field. Is this even possible?
Is this SQL Query correct?
ALTER TABLE mybb_users MODIFY views int NOT NULL DEFAULT '0'

somebody gave me to fix this error

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1364 - Field 'myforumicons_icon' doesn't have a default value
Query:
INSERT INTO mybbcn_forums (name,description,linkto,type,pid,parentlist,disporder,active,open,allowhtml,allowmycode,allowsmilies,allowimgcode,allowvideocode,allowpicons,allowtratings,usepostcounts,usethreadcounts,requireprefix,password,showinjump,style,overridestyle,rulestype,rulestitle,rules,defaultdatecut,defaultsortby,defaultsortorder) VALUES ('special zones','','','c',0,'',1,1,1,0,1,1,1,1,1,1,1,1,0,'',1,0,0,0,'','',0,'','')
(2009-01-30, 03:57 PM)Matt Wrote: [ -> ]Set all people to recieve admin emails (requires template changes to remove option to change again):
UPDATE `mybb_users` SET `allownotices` = '1' WHERE `allownotices` = '0'

Set all people to recieve PMs (requires template changes to remove option to change again):
UPDATE `mybb_users` SET `receivepms` = '1' WHERE `receivepms` = '0'

Where do I change and what do I change in the template ?
Find the specific lines u want to disable in usercp_options template and usercp_options_pm
and change the input type to "hidden", also make sure the default "values" are as u want.

Important: Don't remove them completely!
(2017-05-15, 12:13 PM)thelovelyone Wrote: [ -> ]Find the specific lines u want to disable in usercp_options template and usercp_options_pm
and change the input type to "hidden", also make sure the default "values" are as u want.

Important: Don't remove them completely!

Thanks for the help Smile

I don't have a "usercp_options_pm" Huh  

I'm running the Duende-V2 theme if that helps
Great thread,many thanks !!!

my issue
Im trying to mass check the box "Notify by email when new private message is received"  through an mysql query for all existing user with this :

UPDATE mybb_users SET pmnotify = 'yes';


and im getting this message:

Quote:Warning: #1366 Incorrect integer value: 'yes' for column 'pmnotify' at row 1


Im not so skilled and need help how to do it...

best regards
UPDATE mybb_users SET pmnotify = 1;

It's an integer column so won't accept a string.
(2021-12-30, 06:08 PM)Matt Wrote: [ -> ]
UPDATE mybb_users SET pmnotify = 1;

It's an integer column so won't accept a string.

Like a charm,perfect as always !!!

Many thanks Sir and happy holidays

br
Pages: 1 2 3 4 5 6