0
        $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 auto increments. I do not know to find errors. I do not understand what is happening.

1

1 Answer 1

2

You have 7 parameters here:

$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:

$stmt= $mysqli->prepare("insert into book_project.personal_details(name,email,cc_num,address,city,zipcode) values (?,?,?,?,?,?)");
Sign up to request clarification or add additional context in comments.

3 Comments

where are there 7 params! I see 6 everywhere!
'ssssss' is the first (or seventh) which shouldn't be there.. (@CodeBird)
yeah bind_param ( string $types , mixed &$var1 [, mixed &$... ] ) the first ssssss is the types ----> jp.php.net/manual/en/mysqli-stmt.bind-param.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.