Prepared statement help, Number of variables doesn't match number of parameters in prepared statement
- by Sam Gabriel
I'm getting this error : Number of variables doesn't match number of parameters in prepared statement
every time I run this code:
$dbh = new mysqli("localhost", "***", "***", "pics");
$stmt = $dbh->prepare("INSERT INTO comments (username, picture, comment) VALUES (?, ?, ?)");
$stmt->bind_Param('s', $username);
$stmt->bind_Param('d', $picture);
$stmt->bind_Param('s', $comment);
$username=$_SESSION['username'];
$picture=$_GET['id'];
$comment=$_POST['comment'];
$stmt->execute();
What's the problem?