MyBB Community Forums

Full Version: SQL Query Needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to run a query to set every user to a specific option of a custom field.

Ive added a "What mybb version are you using" custom field.

Options:
N/A
1.4
1.5
1.6
et......

I want to set every user to N/A if they hav'nt selected an option, any ideas?
Replace 3 with the id of your field :p

Update mybb_userfields SET fid3='N/A' WHERE fid3='';
Hmmm , it didnt effect any rows "Affected rows: 0 (Query took 0.0004 sec)"
Worked for me are you sure the existing ones are empty?
Yea there empty, heres a link to a random user : http://www.mybbextras.com/member.php?act...ile&uid=45

You'll see that the "Select your mybb version" field is empty
Any ideas why this query is not working ?

So annoying , works for fid3 but not for fid4
Can you print screen the mybb_userfields table so we can see what data is already there, please blur out any sensitive data.
Ok ive noticed something , it say NULL beside ID4


Yea that was the problem , got it now , thanks tim Big Grin