The error occurs on line 42:
$result->bind_param("ssssisssss", $Firma, $Partner, $Abteilung, $Strasse, $PLZ, $Ort, $Telefon, $Email, $Website, $Info );
This is the whole prepared statement:
$sql = "INSERT INTO `firmen` (`Firma`, `Ansprechpartner`, `Abteilung`, `Strasse`, `PLZ`, `Ort`, `Telefon`, `Email`, `Website`, `Zusatzinfos`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$result = $db->prepare( $sql );
$result->bind_param("ssssisssss", $Firma, $Partner, $Abteilung, $Strasse, $PLZ, $Ort, $Telefon, $Email, $Website, $Info );
$result->execute();
I can't find the mistake, I already read almost every question with the same mistake an I also compared my Code with a lot of Tutorial and it looks exactly the same...
Thanks in advance!
one extra parameters so i removed first parameter: change the following
with
Here you have you have 10 value in the insert statement
and you are giving 11 parameters in the
bind->param()
like thisSo you have to corret the number of arguments. So either add another column in the insert statement or remove one value from the
bind->param()
and keep your insert statement as it is.Your error is in the below code
$sql = "INSERT INTO
firmen
(Firma
,Ansprechpartner
,Abteilung
,Strasse
,PLZ
,Ort
,Telefon
,Email
,Website
,Zusatzinfos
)delete the apostrophe ('') from each as
$sql = "INSERT INTO firmen (Firma, Ansprechpartner, Abteilung, Strasse, PLZ, Ort, Telefon, Email, Website, Zusatzinfos)
...usually this occurs when you have an error in prepare statement, It might happen that you have a typo in sql prepare. to verify that. check the error with this
As the error-message says,
$result
seems to be not an object. try to debug this by usingvar_dump($result);
right after your prepare-call.It looks like you're using PHP's PDO. In that case, take a look at the documentation.
If the database server successfully prepares the statement, PDO::prepare() returns a PDOStatement object. If the database server cannot successfully prepare the statement, PDO::prepare() returns FALSE or emits PDOException (depending on error handling).
ALso, what is "sisssssss"? 10 values are needed and you insert 11.
Hm, change this query:
Into this:
This one
'
and ` are not the same.