I want to save form informations in my database. Without the statements it works but i want to include them.
When I submit the form I get the following error messages:
-Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables
-Fatal error: Uncaught Error: Call to undefined function execute()
<?php
$id= " 1"; $firstname = $_POST["Vorname"]; $lastname = $_POST["Nachname"]; $email = $_POST["EMailAdresse"]; $msg = $_POST["IhrAnliegen"];
$mysqli = new mysqli("localhost", "user", "password", "database"); if ($mysqli->connect_errno) {
die("Verbindung fehlgeschlagen: " . $mysqli->connect_error); }
$sql = "INSERT into Requests SET email ='$email' , firstname
='$firstname' , lastname = '$lastname' , msg = '$msg'"; $statement = $mysqli->prepare($sql); $statement->bind_param("s", $email ,$firstname ,$lastname ,$msg);
$statement = execute()
?>