Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
sittingduck
Hangin' Around



Joined: Oct 20, 2005
Posts: 26

PostPosted: Wed Nov 02, 2005 3:20 am Reply with quote

I want to edit the nuke_users table so that anyone with user_timezone -7 gets changed to user_timezone -8.

Is this possible without manually changing each one? I figured out how to list ONLY the users with -7, but I have no idea how to edit them en masse. Or if it is even possible.
 
View user's profile Send private message Visit poster's website ICQ Number
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Nov 02, 2005 6:47 am Reply with quote

Yes, it is possible. I will assume that you have access to a tool like phpMyAdmin so that you can run a SQL command. I will also assume that you have not changed your $prefix so that all your tables start with "nuke_". Try this:

Code:


UPDATE `nuke_users` SET `user_timezone` = -8


Now, make CERTAIN you really want to change everyone's timezone because this will change everyone in the database.

Regards,
montego

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
sittingduck







PostPosted: Wed Nov 02, 2005 11:09 am Reply with quote

I checked all my users, and except for a couple that hadn't changed from default, all were either -7 or already -8. (mostly local people) The SQL command worked perfectly, THANKS!

I just discovered that it could be taken one step futher, with the WHERE command like so:

UPDATE nuke_users SET user_timezone = -8 WHERE user_timezone = -7

Smile
 
Steptoe
Involved
Involved



Joined: Oct 09, 2004
Posts: 293

PostPosted: Wed Nov 02, 2005 1:33 pm Reply with quote

Out of interest, what is the thinking behind doing so?

_________________
My Spelling is NOT incorrect, it's Creative 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Nov 02, 2005 1:37 pm Reply with quote

sittingduck wrote:
I checked all my users, and except for a couple that hadn't changed from default, all were either -7 or already -8. (mostly local people) The SQL command worked perfectly, THANKS!

I just discovered that it could be taken one step futher, with the WHERE command like so:

UPDATE nuke_users SET user_timezone = -8 WHERE user_timezone = -7

Smile
Whew! I was just getting ready to tell you to be sure to add that WHERE clause Laughing
 
View user's profile Send private message
sittingduck







PostPosted: Wed Nov 02, 2005 1:42 pm Reply with quote

Steptoe wrote:
Out of interest, what is the thinking behind doing so?


Daylight savings time causes the forum to be off by an hour. Meaning in my timezone (GMT -Cool settings need to be at -7 for the time to display properly. When we recently went back to standard time, it meant that -7 was now an hour off! So, instead of telling everyone (or waiting for them to figure it out) to change their timezone settings, I did it through the database.
 
sittingduck







PostPosted: Wed Nov 02, 2005 1:45 pm Reply with quote

Raven wrote:
Whew! I was just getting ready to tell you to be sure to add that WHERE clause Laughing


Smile Thanks Raven, I actually ran the command without the WHERE, because all of my users are in the same timezone. Someday that may chage though, so I am glad to be aware of the ability to single out specific values.
 
Steptoe







PostPosted: Wed Nov 02, 2005 2:07 pm Reply with quote

[ Only registered users can see links on this board! Get registered or login! ]
There maybe some added usefull info there for u...check dates in the 1st code blocks
 
sittingduck







PostPosted: Wed Nov 02, 2005 2:21 pm Reply with quote

Steptoe wrote:
http://www.ravenphpscripts.com/posts6960-highlight-.html
There maybe some added usefull info there for u...check dates in the 1st code blocks


Whoa now, I just figured out how to run an SQL query, what makes you think I'm ready to decipher all that? Razz maybe someday...


Last edited by sittingduck on Wed Nov 02, 2005 3:09 pm; edited 1 time in total 
Steptoe







PostPosted: Wed Nov 02, 2005 2:55 pm Reply with quote

just the country and dates preceeded by ///
 
Raven







PostPosted: Wed Nov 02, 2005 3:29 pm Reply with quote

Steptoe wrote:
http://www.ravenphpscripts.com/posts6960-highlight-.html
There maybe some added usefull info there for u...check dates in the 1st code blocks

I just added to that post [ Only registered users can see links on this board! Get registered or login! ] to explain an easy way to automatically calculate it Smile
 
montego







PostPosted: Wed Nov 02, 2005 5:42 pm Reply with quote

Awesome Raven!! Looking forward to the new release. Good stuff.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©