Strats Posted April 26, 2009 Posted April 26, 2009 After I was hacked a few little problems popped up, some people said their stats had been changed. So I thought games only a few days old I will reset everyone stats. Without thinking I dumped user stats sql. I kinda thought I could just insert it again and every thing would be as new. Wrong lol, I get this message on my header and when I go to my gym : QUERY ERROR: 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 'AND us.userid != 1 AND u.user_level != 0' at line 1 Query was SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.strength > AND us.userid != 1 AND u.user_level != 0 Can some one explain what I did wrong and how I can fix it? Quote
wolfe Posted April 26, 2009 Posted April 26, 2009 Re: Query Error You should have just reset all the stats to 0 instead of dumping the whole thing. When a user is created their id is also inserted into stats (along with the default stats) dumping that means that none of the players that existed before the dump have stats. So basically what i see is there is no record to join with in the userstats table. Do you have a backup that you can just run? Quote
Strats Posted April 26, 2009 Author Posted April 26, 2009 Re: Query Error I see if I delete the users and start fresh will this work ok then cause it will be starting fresh from Id 1 Quote
wolfe Posted April 26, 2009 Posted April 26, 2009 Re: Query Error well yeah if you start fresh and dump your data in both tables it should work. You want to also dump your inventory tables, etc. anything with a userid associated with it. Quote
Strats Posted April 26, 2009 Author Posted April 26, 2009 Re: Query Error You gave me the best idea :D Just before I was hacked I did back up my sql :lol: I managed to just upload everyone's stats back :lol: Quote
wolfe Posted April 26, 2009 Posted April 26, 2009 Re: Query Error there you go. make sure to check everyone who registered after the hack. you'll need to manually insert their stats or delete the account. Quote
Strats Posted April 26, 2009 Author Posted April 26, 2009 Re: Query Error there you go. make sure to check everyone who registered after the hack. you'll need to manually insert their stats or delete the account. 8-) Yup, All done. Thank you for that push in the right direction. 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.