开发者

I have more errors within mysql

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 email) VALUES ('','','')' at line 1

i am now getting this error for specifically this line:

$sql= "INSERT INTO tbl_member (username, password and email) VALUES ('$username','开发者_运维知识库$password','$email')";


It should be:

$sql= "INSERT INTO tbl_member (username, password, email) VALUES ('$username','$password','$email')";


First of all, you don't use the 'AND' keyword like that.

$sql = "INSERT INTO tbl_member (username, password, email) VALUES ('$user','$pass','$mail')";

Secondly, the error message indicates that at the time the query is run the 3 variables, $user, $pass and £mail are empty.


What are the names of your columns? if it's really "password and email", you should use backticks surronding them:

$sql= "INSERT INTO tbl_member (`username`, `password and email`) VALUES ('$username','$password','$email')";

otherwise use @Shivan-Raptor 's sollution?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜