SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Reset User Table
-
Mar 16, 2008, 09:41 #1
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 355
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Reset User Table
Im trying to reset all users in my table back to scratch, but not sure how I can do that so I need some help.
I tried first something like this, but it didnt seem to work
Code:mysql_query("UPDATE `$playerdb` ( SET rank='0', SET clan='0', SET clan_tres='0', ........
//R
-
Mar 16, 2008, 10:01 #2
- Join Date
- Feb 2004
- Location
- Staffordshire, UK & Florida, USA
- Posts
- 314
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You were on the right lines, just your syntax was incorrect:
Code:mysql_query("UPDATE `$playerdb` SET rank='0', clan='0', clan_tres='0',...
-
Mar 16, 2008, 10:06 #3
- Join Date
- Feb 2004
- Location
- Tampa, FL (US)
- Posts
- 9,854
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
have you look at the mysql manual page for UPDATE? you have a pretty obvious syntax error.
also, don't quote numbers. its not portable.
-
Mar 18, 2008, 05:25 #4
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 355
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ok thanks I got it
Here is my new sql query, but I get an error but cant see whats wrong and all the table names are correct, but I havent double checked
Code:UPDATE long2_players ( SET rank=0, clan=0, clan_tres=0, forces=0, allytime=0, attacks=0, offsucc=0, offtotal=0, defsucc=0, deftotal=0, kills=0, turns=0, turns_last=0, hour_last=0, turnsstored=0, turnsused=0, networth=0, cash=100000, food=10000, peasants=500, health=100, wizards=0, runes=500, shield=0, gate=0, land=250, shops=5, homes=20, industry=0, barracks=5, labs=0, farms=15, towers=0, freeland=205, tax=10, savings=0, turnbank_last=0, turnbank=0, loan=0, pvmarket_last=0, pmkt_food=100000, bmper_last=0, aidcred=5, aidcred_got=0, msgcred=10, msgcred_got=0, msgtime=0, newstime=0, loggedin=0, hero_war=0, hero_peace=0, hero_special=0, heroes_used=0, warset=0, warset_time=0, warset_known=0, peaceset=0, peaceset_time=0, l_attack=0, num_bounties=0, hide=0, condense=1, atkforstruct=1, folders=0, menu_lite=0, validated=1, vote=0, newssort=0, std_bld=1, motd=0, lastdroptime=0
Originally Posted by phpmyadmin
-
Mar 18, 2008, 07:39 #5
- Join Date
- Feb 2004
- Location
- Tampa, FL (US)
- Posts
- 9,854
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
you still have the same error that djones pointed out.
Last edited by longneck; Mar 18, 2008 at 09:20.
-
Mar 18, 2008, 08:01 #6
- Join Date
- Aug 2004
- Location
- Norway
- Posts
- 355
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well I removed the ( and it worked
Bookmarks