我使用此代码,但它不会插入我的数据库..请帮助我
mysqli_query($link,
"INSERT INTO `usertable`(`id`, `username`, `password`)
VALUES (NULL,'$username','$password')"
);
答案 0 :(得分:2)
mysqli_query("INSERT INTO `usertable`(`username`, `password`)
VALUES ('$username','$password')"
);
数据库集ID自动增量。
答案 1 :(得分:2)
mysqli_query($link,
"INSERT INTO `usertable`(`username`, `password`)
VALUES ('$username','$password')"
);
然后运行sql
ALTER TABLE `usertable` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
答案 2 :(得分:0)
mysqli_query($ link,“ INSERT INTO usertable VALUES(NULL,$ username','$ password')“);