gurpreet Posted January 21, 2009 Posted January 21, 2009 UPDATE users SET crystals=1 WHERE crystals <=6050 AND =>4000 basically, when I was starting my game and stuff and I gave mass payments of like 5000, 1000, 250, etc. and some people used a few crystals, then stopped playing (100+ days ago last movement). So I want to make it so if someone has inbetween 6050 crystals and 4000 (nobody has it who is active) then it will set their crystals to 1. I use the code above and it says: There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unknown Punctuation String @ 55 STR: => SQL: UPDATE users SET crystals=1 WHERE crystals <=6050 AND =>4000 SQL query: UPDATE users SET crystals=1 WHERE crystals <=6050 AND =>4000 MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=>4000' at line 1 Quote
Lithium Posted January 21, 2009 Posted January 21, 2009 Re: PHPMYADMIN query UPDATE users SET crystals=1 WHERE crystals BETWEEN 4000 AND 6050 Quote
gurpreet Posted January 21, 2009 Author Posted January 21, 2009 Re: PHPMYADMIN query So simple...I suck at SQL, thought it would use the MCcodes query format. +1 for this, thanks, and delete topic when a mod sees this. Thanks again Quote
Lithium Posted January 21, 2009 Posted January 21, 2009 Re: PHPMYADMIN query lol the problem is that most of people around uses SQL statements as they have seen it (limited to 4 or 5). So why bother using more? ;) you could also use it as a "regular query format" as you call it! UPDATE users SET crystals=1 WHERE crystals>4000 AND crystals<6050 though using BETWEEN is faster ;) Quote
CLANG Posted January 21, 2009 Posted January 21, 2009 Re: PHPMYADMIN query So simple...I suck at SQL, thought it would use the MCcodes query format. +1 for this, thanks, and delete topic when a mod sees this. Thanks again No point deleting it. It could a help a lot more people who might be having the same issues as you have just had. However, most people cant be bothered reading through old posts for help and they just resort to creating a new topic. Oh well Quote
Croesy Posted January 22, 2009 Posted January 22, 2009 Re: PHPMYADMIN query Your query was simply incorrect. You have: AND =>4000 instead of AND >=4000. You just had the "=" and ">" the wrong way around. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.