Fatal error: Call to a member function bind_param() on a non-object
Code: Select all
<?php
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$email = $_POST["email"];
$zipcode = $_POST["zipcode"];
$country = $_POST["country"];
$comment = $_POST["comment"];
$conn = mysqli_connect("localhost", "root", "", "testdb");
$stmnt = $conn->prepare("INSERT INTO testtable (firstName, lastName, email, zipcode, country, comment)
VALUES(?, ?)");
$stmnt->bind_param("sssiss", $firstName, $lastName, $email, $zipcode, $country, $comment);
$stmnt->execute();
$stmnt->close();
$conn->close();
?>