简体   繁体   English

MySQL查询不会将数据插入表中

[英]MySQL query is not inserting data into the table

        $stmt= $mysqli->prepare("insert into book_project.personal_details(name,email,cc_num,address,city,zipcode) values (?,?,?,?,?,?)");

        var_dump($_SESSION);

        $stmt->bind_param('ssssss',$_SESSION['name'],$_SESSION['email'],$_SESSION['cc_num'],$_SESSION['address'],$_SESSION['city'],$_SESSION['zipcode']);

        $stmt->execute();

        $stmt->close();
}   

I have a id column as primary key have not included it. 我有一个id列作为主键没有包含它。 id auto increments. id自动增量。 I do not know to find errors. 我不知道发现错误。 I do not understand what is happening. 我不明白发生了什么。

You have 7 parameters here: 这里有7个参数:

$stmt->bind_param('ssssss',$_SESSION['name'],$_SESSION['email'],$_SESSION['cc_num'],$_SESSION['address'],$_SESSION['city'],$_SESSION['zipcode']);

But there are only 6 placeholders in the SQL query: 但是SQL查询中只有6个占位符:

$stmt= $mysqli->prepare("insert into book_project.personal_details(name,email,cc_num,address,city,zipcode) values (?,?,?,?,?,?)");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM