spikereloaded Posted January 16, 2012 Posted January 16, 2012 hey guys one of my users is getting this error: 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 != 135 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 != 135 AND u.user_level != 0 i cant seem to work out why. no one else seems to be having this problem. he says this appears when he clicks on the gym. thanks Quote
Nickson Posted January 16, 2012 Posted January 16, 2012 this is your query SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.strength > AND us.userid != 135 AND u.user_level != 0 Notice the WHERE us.strength > AND it's saying WHERE strength is larger than oopsy! we're missing here something AND Find the query in the php code, and make sure there is some variable there, and that it is set. Quote
spikereloaded Posted January 16, 2012 Author Posted January 16, 2012 ah ok i see what you mean, how come it's only effecting one user though?? Quote
Nickson Posted January 16, 2012 Posted January 16, 2012 That's something I can't tell you. Either he's doing something he shouldn't. This could happen via unchecked input on forms. Or something goes wrong when retrieving the value. Another possibility is that he doesn't have any value in the database for that variable. In that case, you might have a structural problem though. Quote
spikereloaded Posted January 16, 2012 Author Posted January 16, 2012 thanks for the help Nickson. i looked in the user stats table and he didnt have any stats?!? not sure why, so just created a new row and its sorted. cheers for the help! 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.