Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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?

Posted

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.

Posted

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:

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...