gpt4 book ai didi

我认为 PHP 错误无法弄清楚与 SQL 相关的东西

转载 作者:行者123 更新时间:2023-11-29 13:07:31 26 4
gpt4 key购买 nike

好的,错误出现在这段代码中的某处

    if($error==false) {

$query = pg_query("INSERT INTO chatterlogins(firstName, lastName, gender, password, ageMonth, ageDay, ageYear, email, createDate) VALUES('$firstNameSignup', '$lastNameSignup', '$genderSignup', md5('$passwordSignup'), $monthSignup, $daySignup, $yearSignup, '$emailSignup', now());");
$query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$email', now())";);
$_SESSION['$userNameSet'] = $email;
header('Location: signup_step2.php'.$rdruri);

}

有人看到我做错了吗???很抱歉这么不具体,但我已经盯着它看了 10 分钟,但我无法弄明白。

最佳答案

$query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$email', now())";);

靠近末尾的分号 (;) 放错了位置。它应该在字符串内:

$query = pg_query("INSERT INTO chatterprofileinfo(email, lastLogin) VALUES('$email', now());");

关于我认为 PHP 错误无法弄清楚与 SQL 相关的东西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2568822/

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