gpt4 book ai didi

PHP - 将用户注册到字段多于所需的数据库

转载 作者:太空宇宙 更新时间:2023-11-03 11:10:38 24 4
gpt4 key购买 nike

我在注册时检查的字段:

if($username&&$email&&$password&&$repeatpassword) { }

我有大约 10 个字段,所以我的注册查询如下所示:

$queryreg = mysql_query("INSERT INTO users VALUES(
'','$username','','$password','$email','','','','','',''
)");

die ("You have been registered.");

当我尝试注册时,它告诉我我已成功注册,但没有将用户添加到数据库中。数据库名称和密码正确。

最佳答案

我觉得你的 SQL 查询不对,应该更像是:

INSERT INTO `users` (ID, Username, Password, Email) VALUES ('$id', '$username', '$password', '$email' )

首先是列,然后是值:)

关于PHP - 将用户注册到字段多于所需的数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8901847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com