2017-06-03 53 views
0

我收到以下错误得到错误PDO/SQL

enter image description here

链接DBconfig.php - >

链接代码 - >

enter image description here

灿你们请帮助我;)

谢谢!

我的代码 - >

<?php 
    include '../header.php'; 
    include '../dbconfig.php'; 

    if(isset($_POST['registreer'])){ 

     $naam = $_POST['naam']; 
     $email = $_POST['email']; 
     $wachtwoord = $_POST['wachtwoord']; 

     $insert = $db->prepare("INSERT INTO klant(naam, adres, postcode, email, password) 
     values(:name, :adres, :postcode, :woonplaats, :email, :pass) "); 

     $insert->bindParam(':naam',$naam); 
     $insert->bindParam(':adres',$adres); 
     $insert->bindParam(':postcode',$postcode); 
     $insert->bindParam(':woonplaats',$woonplaats); 
     $insert->bindParam(':email',$email); 
     $insert->bindParam(':wachtwoord',$wachtwoord); 

     $insert->execute(); 
    } 
?> 
+0

你的代码和错误信息添加到这个问题。 – chris85

+0

这是链接到代码 - > https://gyazo.com/cb0f64c9243057df1970075838967a49 – EazyNation

+0

代码需要在这里,你至少有2个拼写错误,我可以从屏幕截图中看到 – chris85

回答

0
values(:name, :adres, :postcode, :woonplaats, :email, :pass) "); 

你有参数:name:pass但在你绑定你在荷兰拼写他们:

$insert->bindParam(':naam',$naam); 
$insert->bindParam(':wachtwoord',$wachtwoord); 

PDO不知道怎么翻译英语和荷兰语之间的参数名称。 :-)

0

您正在发送许多参数。

$insert = $db->prepare("INSERT INTO klant(naam, adres, postcode, email, password) values(:name, :adres, :postcode, :woonplaats, :email, :pass) "); 

你有INSERT INTO “NAAM,ADRES,邮政编码,电子邮件地址和密码”(这是5) 而你试图插入6个值。 “名称,ADRES,邮编,woonplaats,电子邮件和通过。

对不起,我可怜的格式化,我是在移动。