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
(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.
(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.
Thanks for sharing the tut, excellent.
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
Did you remember to replace all files, including ones in the admin directory when you did the upgrade?
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/*.*'
^ what you mean by namestyles image ?
(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
^ 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/%'
(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
Pages: 1 2 3 4 5 6