UBB.Dev
Posted By: ehm How to change one field on the database? - 02/17/2003 12:47 AM
I hate when it happens to me.
I read someone else question about how to change one field at whole users database.
Was someting like changing "Visible" or "Email Notifications"... one of those Yes/No awnser at the end of each users profile.
Was a SQL command to change all users to one kind of awnser.
Well, I lost it, and I used the Search and still didn't find it.
There is any chance to get that awnser again?
I just need one SQL line command to change all users to be Visible.
Thank you and sorry
Posted By: omegatron Re: How to change one field on the database? - 02/17/2003 12:54 AM
Depends on what you are looking for
Email Notification for instance if you want all members to yes you will need to do two sql queries since some are saved with a off and others are blank

UPDATE w3t_Users SET U_Notify='On' WHERE U_Notify='Off'

UPDATE w3t_Users SET U_Notify='On' WHERE U_Notify=''

You get the general drift from the command line above This will Update everyone to On so you can send email to all.
Posted By: ehm Re: How to change one field on the database? - 02/17/2003 1:03 AM
Thank you
I copy it and saved now
I just need one example, so I can figurout how the other fields will work
Us the top one as an example then. The second one is because I noticed that specific field U_Notify sometimes people do not fill it in and the field is blank in the database so you need to do the second query to update all.

Now another example

UPDATE w3t_Users SET U_Title='newtitle' WHERE U_Number='theirusernumber'
Posted By: JoshPet Re: How to change one field on the database? - 02/17/2003 1:42 AM
And if you want to set everyone the same... for example set everyone to use the default stylseheet....

UPDATE w3t_Users
SET U_StyleSheet = 'usedefault'


By George I think with all the examples he will be updating MYSQL in his sleep.
© UBB.Developers