gpt4 book ai didi

PHP通过ajax插入MySQL数据类型错误

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

我已经通过ajax插入了数据并且插入了数据但给出了错误[错误:

INSERT INTO jobify_user (u_name,u_phonenumber,u_email,u_password) VALUES 

('','','','')

[1]Incorrect integer value: '' for column 'u_phonenumber' at row 1]

$sql = "INSERT INTO jobify_user (u_name,u_phonenumber,u_email,u_password)

VALUES ('$username','$userphonenumber','$useremail','$userpassword')";

if ($conn->query($sql) === TRUE) {

echo "New record created successfully";

} else {

echo "Error: " . $sql . "<br>" . $conn->error;

}

最佳答案

$sql = "INSERT INTO jobify_user (u_name,u_phonenumber,u_email,u_password)

VALUES ('".$username."','".$userphonenumber."','".$useremail."','".$userpassword."')";

if ($conn->query($sql) === TRUE) {

echo "New record created successfully";

} else {

echo "Error: " . $sql . "<br>" . $conn->error;

}

关于PHP通过ajax插入MySQL数据类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31184529/

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