FusionBB
FusionBB Review (large)
Recent Members
Welcome them to our community!
FusionBB SWAG!

FusionBB golf shirts, t-shirts, mousepads and more.

Tagging
FusionBBDev Recent Topics

Handy Links: Frequently Used MySQL Queries | Common MySQL Errors | MySQL.com | phpMyAdmin.net

Username Post: Please list here any useful mysql queries.        (Topic#3677)
Couchtomatoe
Code Monkey
Total Posts: 3049
*
Birthday: 02-03 
Location: Richmond, Virginia
Average Post Ranks%:                       
 
12-30-05 03:50 PM - Post#29097    



This post is for LISTING ONLY not discussing.

To search and replace an avatar link location

UPDATE fbb_user_info
SET info_avatar = REPLACE(info_avatar, 'http://www.yourdomain.com/ubbthreads/', 'http://www.yourdomain.com/fusion/')
WHERE `info_fsa` LIKE '%http://www.yourdomain.com/ubbthreads/%'


To change the color for a group

UPDATE fbb_user_info a, fbb_user_groups b
SET a.info_name_color = '#000066'
WHERE a.user_id = b.user_id
AND b.group_id = '1'

To change the color for a group but only if no color is already set


UPDATE fbb_user_info a, fbb_user_groups b
SET a.info_name_color = '#000066'
WHERE a.user_id = b.user_id
AND b.group_id = '1'
AND a.info_name_color IS NULL


Query to see how many unique users has logged into the forums in the past 24 hours

select user_id, info_user_login, info_last_online
from fbb_user_info
where info_last_online >= (UNIX_TIMESTAMP(NOW()) - 86400)


Force everyone to use a default skin


update fbb_user_info set info_userskin = 'always.use.default'


Count to see how many users use a particular skin

SELECT info_userskin, COUNT( info_userskin ) AS total_used
FROM fbb_user_info
GROUP BY info_userskin
ORDER BY total_used DESC

Since the newer versions are sorted by user names instead of user numbers, it makes it nearly impossible to lookup a user by the number. Here's the query for that. by Dman

SELECT info_display_name
FROM fbb_user_info
WHERE fbb_user_info.user_id = (insert user number for the ???)

Is there a MYSQL query I can run in order to put all my users in the "Users" group ?


UPDATE fbb_user_groups
SET group_id = 'new group id'
WHERE group_id 'old group id'

is there a MYSQL Query I can run to set "Receive mass emails from board administration" to "yes"?

UPDATE fbb_user_info
SET info_receive_emails = 1

ow I can get the e-mail addresses of users who have not been on line for more than a month

SELECT info_real_email,info_user _login, info_last_online
FROM fbb_user_info
WHERE info_last_online <= ((UNIX_TIMESTAMP(NOW()) - 2592000)) AND info_receive_emails = 1

how can I turn everyones email settings who want admin mail to non-html

UPDATE fbb_user_info
SET info_html_email = 0

How Can I Change the default topic view from 30 days or newer to all dates.

update fbb_forums
set forum_topic_age = '0'

How can I perform a mass move of topics

UPDATE fbb_files SET forum_id = 'X' WHERE forum_id = 'Y'
UPDATE fbb_polls SET forum_id = 'X' WHERE forum_id = 'Y'
UPDATE fbb_posts SET forum_id = 'X' WHERE forum_id = 'Y'
UPDATE fbb_topics SET forum_id = 'X' WHERE forum_id = 'Y'
substitute new forum ID number for X and the old forum id number for Y.

If table fbb_page_cache crashes and needs to be wiped clean: thanx Gregori

TRUNCATE TABLE fbb_page_cache

To clear all titles

UPDATE fbb_user_info SET info_title_custom = ''

To clear out specific titles

UPDATE fbb_user_info SET info_title_custom = '' WHERE info_title_custom = '1234'

How to turn all signatures on

UPDATE fbb_user_info SET info_hide_sigs = 0

How to force birthdays to Show

update fbb_user_info set info_sharebirthday = 1

How to add a group of users into another group as well

insert into fbb_user_groups (group_id, user_id) select group_id, user_id from fbb_user_info, fbb_groups where user_id > 1 and group_id = #

where # is the group_id of the group you want to place them..

How do I force all users visible

UPDATE fbb_user_info SET info_visible = 1;


How do I alter someone's post count?

UPDATE fbb_user_info SET info_total_posts = '999' WHERE user_id = '123'
The artist formerly known as scroungr
Couch-Tomatoe


 
Couchtomatoe
Code Monkey
Total Posts: 3049
*
Birthday: 02-03 
Location: Richmond, Virginia
Average Post Ranks%:                       
 
12-30-05 03:52 PM - Post#29098    


    In response to Couchtomatoe

Please list any new queries here so we can keep them all in one place
The artist formerly known as scroungr
Couch-Tomatoe


 
Gregori
FusionBB Enthusiast
Total Posts: 451
*
Average Post Ranks%:                       
 
01-04-07 10:32 AM - Post#41357    


    In response to Couchtomatoe

If table fbb_page_cache crashes and needs to be wiped clean:

TRUNCATE TABLE fbb_page_cache
 
Gregori
FusionBB Enthusiast
Total Posts: 451
*
Average Post Ranks%:                       
 
05-03-07 12:32 PM - Post#44823    


    In response to Gregori

Couch, there's an "e" missing in "TRUNCATE TABLE fbb_page_cach"!
 
Couchtomatoe
Code Monkey
Total Posts: 3049
*
Birthday: 02-03 
Location: Richmond, Virginia
Average Post Ranks%:                       
 
05-03-07 04:25 PM - Post#44832    


    In response to Gregori

thanx
The artist formerly known as scroungr
Couch-Tomatoe


 
Ghost
FusionBB Newbie
Total Posts: 1
*
Average Post Ranks%:                       
04-09-11 02:31 PM - Post#85335    


    In response to Couchtomatoe

Hello guys,
it's something i am banging my head for so long.
I want to include latest 10(15) hot topics from forums inside another site located at different hosting account (can not use the external use box provided in the admin.)
So i wonder if you guys can help me and give me simple mysql command that will fetch these 10(or 15) hot topics.

Thank you guys. I hope you can help me with this.

P.S. I need only the query, i'll fix the rest.

Edited by Ghost on 04-09-11 02:31 PM. Reason for edit: No reason given.
 
thomaswinter
FusionBB Newbie
Total Posts: 5
*
Average Post Ranks%:                       
09-06-11 08:56 AM - Post#85557    


    In response to Ghost

thanks ..these are really helpful
 
mariya
FusionBB Newbie
Total Posts: 1
*
Average Post Ranks%:                       
11-24-12 06:08 AM - Post#86328    


    In response to thomaswinter

Drop table;
Alter table;
Insert into table_name values("A","a");
Back me up
 
Icon Legend Permissions & Sharing Options Topic Options
Print Topic


5475 Views
Calendar
SMTWTFS
 1234
567891011
12131415161718
19202122232425
262728293031 
Current Quote
"I installed fusion, even in BETA forum, it kicks the lightbulbs ***. Nearly everything can be configured to our tastes right out of the beta box!

Imagine full releases!"
~ kestral
FusionBB™ Version 3.2 | ©2003-2013 InteractivePHP, Inc.
Execution time: 0.088 seconds.   Total Queries: 168   Zlib Compression is on.
All times are (GMT-4). Current time is 08:43 AM
Top