PDA

View Full Version : 1st SQL query - Am I doing it correctly?


93Corvette
05-29-2009, 06:40 AM
Have a question concerning SQL queries.

Being the 1st time I do this I don't want to mess anything up:

Example: Suppose the settings I want all of my users to be like this:
(UCP>Edit Option>Date & Time Options
Automatically detect DST setting = N
Is DST currently in effect = Y

I have already allowed my SQL query search to work.
(ACP>Maintenance>Execute SQL query>Manual Query)
So do I just type in the following command in the Manual Query block?
Off: UPDATE user SET options=options - 64 WHERE options & 64
On: UPDATE user SET options=options + 128 WHERE NOT(options & 128)

1. Do I type both of these in the same manual block?
2. Do I use the On: and Off: command or are they just saying that what it does?
3. Anything I should do before hand? i.e which files should I back up?
4. God this freaks me out!!!

Here is the thread that I think shows me the commands:
http://www.vbulletin.com/forum/showpost.php?p=1273589&postcount=1

Thanks is advance!!!

Lynne
05-29-2009, 03:32 PM
You do not put in the "Off:" or "On:". Using your queries as examples, you would actually type in:
UPDATE user SET options=options - 64 WHERE options & 64
or
UPDATE user SET options=options + 128 WHERE NOT(options & 128)

I always try things out on my test site first, so you may want to do that.

93Corvette
05-29-2009, 10:50 PM
Thanks Lynne,
So it seems like the 1st thing I need to do is figure out how to make a test site...-ha
I truly don't have one, but I know I need to have one, so, I best research that 1st...

Thanks again for your input....