Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 May 2010, 16:07
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Question SQL Query to add one columns value to another colum

OK So I had several add-ons installed at once... First the Casino which stored cash as casino_cash in the user table... then I had the Gameroom which uses gameroom_cash. Also I have stock trader that doesn't store any value in the user table but can use any field I set. After upgrading to the Gameroom I never changed the field in Stock Trader to gameroom_cash until today so for sometime they were being tracked separately. What I need to do now is run a query where I set the gameroom_cash value to itself+casino_cash value- if it was a php variable it would be something like gameroom_cash = gameroom_cash + casino_cash- but I don't know how to do this as a sql statement. I searched google but most entries that came up were for me to add a new column rather then add value to a column.
__________________
-Joe
Qapla.com - Exclusive VB Mods! | Joe's Ultimate Off Topic | My Free VB "Mods"
You can PM me if you want but be warned I do not read them often.
Reply With Quote
  #2  
Old 28 May 2010, 16:12
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
You can run the query to pull the info for both columns and then add it in the PHP code after the query.
Reply With Quote
  #3  
Old 28 May 2010, 16:42
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
That's true... just wondering if it was possible as a query instead of writing a script... but the script would be so easy that it probably isn't worth typing this response... LOL.
__________________
-Joe
Qapla.com - Exclusive VB Mods! | Joe's Ultimate Off Topic | My Free VB "Mods"
You can PM me if you want but be warned I do not read them often.
Reply With Quote
  #4  
Old 28 May 2010, 16:52
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
There is no way that I know of to do a query that will add the columns like you want. MySQL doesn't work that way.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 21:12.

Layout Options | Width: Wide Color: