[Tutorial] Common SQL queries and how to run them
#41
(2013-01-06, 02:46 PM)vsinferno Wrote: How do i run this on the admin cp.

You can't. For security reasons MyBB doesn't have this feature. You'll want to use phpmyadmin or a similar application.
No longer involved in the MyBB project.
Reply
#42
(2013-01-06, 02:46 PM)vsinferno Wrote: How do i run this on the admin cp.

If you want to take the risk, here is a plugin you can use.
Reply
#43
Thanks for sharing the tut, excellent.
Reply
#44
How can I remove a user group with a sql query as most the buttons in admin cp don't work since I upgraded to 1.8 as ive got a issue where on the group page it shows about 1500 members but there is only just over 800 members on my forum so I'm guessing this is causing the problem of users not importing to vb4 as im in the process of importing my forun to vb4 and then back to mybb 1.6 as 1.8 is rubbish
please someone release a script to downgrade from 1.8 to 1.6 
Reply
#45
Did you remember to replace all files, including ones in the admin directory when you did the upgrade?
Reply
#46
Hello I recently made a CDN so I wanted to move all my current urls of images on namestyles to the new urls, they all end in the same image number and extension but I wanted to replace example.com/z/imagenumber.imageext to cnd.example.com/i/imagenumber.imageext ...
Could someone give me a hand real quick?
What I tried: UPDATE mybb_usergroups SET namestyle = 'https://cdn.example.com/i/*.*' WHERE namestyle = 'https://example.com/z/*.*'
Reply
#47
^ what you mean by namestyles image ?
Reply
#48
(2016-01-29, 04:39 AM).m. Wrote: ^ what you mean by namestyles image ?

What I tried: UPDATE mybb_usergroups SET namestyle = 'https://cdn.example.com/i/*.*' WHERE namestyle = 'https://example.com/z/*.*'
This will hopefully help you understand, I have more code before this line such as <img and stuff I ONLY want to replace the url of image
Reply
#49
^ query similar to below should work
UPDATE `mybb_usergroups` SET `namestyle` = REPLACE(namestyle, 'https://cdn.example.com/i/', 'https://example.com/z/') WHERE `namestyle` LIKE '%https://cdn.example.com/i/%'
Reply
#50
(2016-01-29, 04:48 AM).m. Wrote: ^ query similar to below should work
UPDATE `mybb_usergroups` SET `namestyle` = REPLACE(namestyle, 'https://cdn.example.com/i/', 'https://example.com/z/') WHERE `namestyle` LIKE '%https://cdn.example.com/i/%'

Changed it to:
UPDATE `mybb_usergroups` SET `namestyle` = REPLACE(namestyle, 'https://example.com/z/', 'https://cdn.example.com/i/') WHERE `namestyle` LIKE '%https://example.com/z/%'
Thanks man <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)