beaurelic Posted July 27, 2013 Share Posted July 27, 2013 (edited) hello im trying to make a forum and i dont know alot about sql but im stuck on this one error #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 'user_name') . "' AND user_pass = '" . sha1($_POST 'user_pass')' at line 3 can somebody please help me Edited July 27, 2013 by beaurelic Link to comment Share on other sites More sharing options...
niche Posted July 27, 2013 Share Posted July 27, 2013 (edited) Try using the post reference as a php variable. EDIT: Most importantly you need to clean your POST to prevent injection. Edited July 27, 2013 by niche Link to comment Share on other sites More sharing options...
beaurelic Posted July 27, 2013 Author Share Posted July 27, 2013 sorry but do you mean putting it in php section or something else (im dutch) Link to comment Share on other sites More sharing options...
dsonesuk Posted July 27, 2013 Share Posted July 27, 2013 $_POST 'user_name' should be $_POST ['user_name'] square brakets should always be used wether $_POST ['user_name'] $_POST [user_name] {$_POST ['user_name']} Link to comment Share on other sites More sharing options...
beaurelic Posted July 27, 2013 Author Share Posted July 27, 2013 thanks dsonesuk it worked Link to comment Share on other sites More sharing options...
niche Posted July 27, 2013 Share Posted July 27, 2013 Using an unvalidated value is very bad practice. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now