gpt4 book ai didi

php - 当我提交表单时,它不断给我错误

转载 作者:行者123 更新时间:2023-11-28 23:13:43 27 4
gpt4 key购买 nike

获取错误:-

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens.

$stmt = $db_con->prepare("INSERT INTO 
tbl_customer(First_name,Last_name,Email, Mobile_number,
Landline_number, Address_1, Address_2, City, Password, Joining_date)
VALUES(:firstname,:lastname, :email, :mbl_nmbr, landline_nmbr,
reg_add1, reg_add2, reg_cus_city, :pass ,jdate)");

$stmt->bindParam(":firstname",$reg_user_first_name);
$stmt->bindParam(":lastname",$reg_user_last_name);
$stmt->bindParam(":email",$reg_user_email);
$stmt->bindParam(":mbl_nmbr",$mobile_number);
$stmt->bindParam(":landline_nmbr",$landline_nmbr);
$stmt->bindParam(":reg_add1",$reg_add1);
$stmt->bindParam(":reg_add2",$reg_add2);
$stmt->bindParam(":reg_cus_city",$reg_cus_city);
$stmt->bindParam(":pass",$password);
$stmt->bindParam(":jdate",$joining_date);

最佳答案

在上面的查询中,您没有将 ":" 放在 bindParam 上。

用这个

$stmt = $db_con->prepare("INSERT INTO 
tbl_customer(First_name,Last_name,Email, Mobile_number,
Landline_number, Address_1, Address_2, City, Password, Joining_date)
VALUES(:firstname,:lastname, :email, :mbl_nmbr, :landline_nmbr,
:reg_add1, :reg_add2, :reg_cus_city, :pass ,:jdate)");

我想它对你有用。

关于php - 当我提交表单时,它不断给我错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44824480/

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