How can I add a user to my MySQL database with PHP. This doe开发者_StackOverflowsn't add a user.
mysql_query("INSERT INTO users (name, password, realname)
VALUES ('$myusername', '$mypassword', '$myrealname'");
What seems to be the problem with my query?
You forgot the closing bracket for VALUES
mysql_query("INSERT INTO users (name, password, realname)
VALUES ('$myusername', '$mypassword', '$myrealname')");
By the way, this code looks dangerous. You escaped everything before to prevent SQL injection, or you are in a very save environment?
Your double quotes should be after the closing bracket.
精彩评论